Help With tuition Problem

hi everyone im struggling to start my program, please a little help will be apreciated


The university of Guinness charges $3000 per semester for ins-state tuition and $4500 per semester for out-of-state tuition. In addition room and board is $2500 per semester for in-state students and $3500 per semester for out-of-state students. Write a program that prompts the user for their residential status (i.e. in-state or out-of-state) and whether they require room and board (Y or N). The program should then compute and output their bill for that semester.
1
2
3
4
5
6
#include <iostream> //You'll need input and output. Let's use the standard io streams.

int main() { //We need an entree point...

    return 0; //Yea, our program ran successfully! We should let the OS know.
}
Is the University of Guiness a real thing?

Also you're probably going to have to at least attempt to do it yourself if you want people to help you.

Meerkat
first of @themeerkat is right, we wont be doing all the work, but we can give you a push in the right direction.

you will need to set up some variables. eg.
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
#include <iostream> //You'll need input and output. Let's use the standard io streams.
#include <cstdlib>

using namespace std; 

int tuition;
int board; // Variables
char status; // here

int main() //We need an entree point...

{ 
//then here is the meat of the program
// prompts the user for their residential status (i.e. in-state or out-of-state)
//for this you can use ' cout' and 'cin'
cout<< " what is your residential status" << endl; // this will prompt the user 
cin<< status << // this gets the user input and stores it in status

// now you need to do an if statement to see what the user has input and then output what 
//the cost is going to be. the logic of the if would be..
//if status is == instate then set tuition and board to the required amount then output the total of them.
// the add an else so if stats is not instat then they are out-of-state then do the same as above but for out-of-state values

    return 0; //Yea, our program ran successfully! We should let the OS know.
}

hope this helps

p.s thanks @Nisheeth ;P
Last edited on
@olzi:
You forgot a / in the code tag!
But there's no need for evil globals here!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream> //You'll need input and output. Let's use the standard io streams.
#include <cstdlib>

using namespace std; 

// not here!

int main() //We need an entree point...
{
    int tuition;
    int board;
    char status; // here!

    ... 
Topic archived. No new replies allowed.