Stuck. Need help please

Write a program to assist the treasurer of the FELS Management Club (FMC) in managing its weekly dues collection at each meeting. At the beginning of each meeting, the treasurer will start the program. For each member that attends the meeting, the treasurer will input in the program, the member’s first name, last name and a code for their membership type. Based on the code entered the program will output the dues to be collected for this member (see table below). The program will then accept how much dues was paid by this member and print “Welcome <insert first name here> <insert last name here>”.

Eg. “Welcome Marsha Brown”

The program will then ask the treasurer whether the meeting has ended. If the meeting is still in progress, the program will allow the treasurer to enter details for another member. However, if the meeting has ended, the program will output a report. The report will include the following: a. Number of visitors in attendance b. Total expected due collection for visitors c. Actual total due collection for visitors d. Number of regular members in attendance e. Total expected due collection for regular members f. Actual total due collection for regular members g. Number of executive members in attendance h. Total expected due collection for executive members i. Actual total due collection for executive members j. Total attendance overall k. Total expected due collection overall l. Total actual due collection overall m. Dues Collection Compliance Rate (Total actual due collection overall / Total expected due collection overall * 100)



#include <iostream>

using namespace std;

int main()
{
string firstname;
string lastname;
int code;
double dues;

cout<<"Please Enter first name: \n";
cin>>firstname;

cout<<"Please Enter last name: \n";
cin>>lastname;

cout<<"\n \nEnter a code between 1 and 100. \nPlease Enter a code: \n";
cin>>code;

cout<<"\nEnter a code to view your dues: \n";
cin>>dues;






return 0;
}





Hello shamar,

Write a program to assist the treasurer of the FELS Management Club (FMC) in managing its weekly dues collection
at each meeting.

At the beginning of each meeting, the treasurer will start the program.

For each member that attends the meeting, the treasurer will input in the program, the member’s first name,
last name and a code for their membership type.

Based on the code entered the program will output the dues to be collected for this member (see table below).

The program will then accept how much dues was paid by this member and print
“Welcome <insert first name here> <insert last name here>”.

Eg. “Welcome Marsha Brown”

Consider each paragraph one step in the program and work on each step one at a time.

When I read through the second part of the instructions I came to the conclusion that there may only be two types of dues not the 100 you prompt for.

If you will be using "std::string" you need to include the header file "<string>".

Hope that helps,

Andy
Thanks Andy. But am still not understanding am new to this so please understand. I read what your saying although I don't fully understand, I tried still and I did this.


#include <iostream>
#include <string>
using namespace std;

int main()
{
string firstname;
string lastname;
int code;
double dues;
char key;
string name;

cout<<"Please Enter first name: ";
cin>>firstname;

cout<<"Please Enter last name: ";
cin>>lastname;

cout<<"Enter a code for membership type: ";
cin>>code;

cout<<"Enter dues: ";
cin>>dues;

cout<<"\nEnter your code to view your dues: ";
cin>>code;

if (key >= '100' )
{

cout<<"Dues to be collected: "<<dues<<endl;

}



cout<<"Welcome " <<firstname<< <<lastname>>endl;






return 0;
}

Hello shamar,

PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <string>
using namespace std;

int main()
{
string firstname;
string lastname;
int code;
double dues;
char key;
string name;

cout<<"Please Enter first name: ";
cin>>firstname;

cout<<"Please Enter last name: ";
cin>>lastname;

cout<<"Enter a code for membership type: ";
cin>>code;

cout<<"Enter dues: ";
cin>>dues;

cout<<"\nEnter your code to view your dues: ";
cin>>code;

if (key >= '100' )
{

cout<<"Dues to be collected: "<<dues<<endl;

}



cout<<"Welcome " <<firstname<< <<lastname>>endl;






return 0;
}


Lines 26 and 27 are redundant. You already ased this for "code" at lines 20 and 21.

Line 29 at this point "key" does not have a value and then you are trying to compare a single character to a constant string which have the wrong quotation marks.

After line 21 it would be best to print the dues expected before you enter the dues collected.

The instructions mentions "(see table below)", but there was no table to look at. I am guessing that this table lists the amount of dues for each type. Useful information when writing a program.

What you have is not what I started with, but it can be made to work.

Looking at the second paragraph can give you an idea of what variables you will need.

Hope that helps,

Andy
Topic archived. No new replies allowed.