Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Background: The purpose of this assignment is to get practice working with m

ID: 3570531 • Letter: C

Question

C++

Background:

The purpose of this assignment is to get practice working with more complex problem solving. For this assignment, you'll be given a large program to write. How you do it is up to you, as long as you use functions and practice passing pass-by-reference and pass-by-value parameters. In general, there are countless ways to correctly solve a certain problem. As a programmer, eventually you should start wondering about the choices you make and which ones lead to a better solution. A number of different program dialogues demonstrate the kind of program I want you to build. Review them closely and try to build a flowchart for the questions asked and determine how the answers are processed.

Project 1: SMC Student Fees
Create a C++ program which calculates student fees for those attending Santa Monica College. IN ORDER TO RECEIVE FULL CREDIT, YOU MUST CREATE FUNCTIONS TO SOLVE THIS PROBLEM WITH BOTH PASS-BY-VALUE AND PASS-BY-REFERENCE PARAMETER (No, main() doesn't count). Summarized in the chart below is the cost calculations I want your program to perform.

SANTA MONICA COLLEGE STUDENT FEES (as of Fall, 2014)

Enrollment Fee

$ 46.00/ unit for California Residents
$ 325.00/ unit for F1/Non-Residents

Student Services Fee
(AS Sticker fee is Optional, saving $19.50)
(ID Card fee is Optional, saving $13)

$ 47.50 Winter/Summer
$ 50.50 Fall/Spring

Parking Decal (Optional)

$ 45.00 Winter/Summer
$ 85.00 Fall/Spring

A number of different program dialogues describe the program I am looking for.

SMC Fee Calculator
Enter number of units enrolled: 18
Is this Fall[0], Winter[1], Spring[2] or Summer[3] session: 0
Are you a state resident[0] or not[1]: 0
Want a parking decal? [y/n]: n
Want an AS sticker? [y/n]: n
Want an ID card? [y/n]: n
For Fall semester, your total fees are $ 846.00

SMC Fee Calculator
Enter number of units enrolled: 6
Is this Fall[0], Winter[1], Spring[2] or Summer[3] session: 1
Are you a state resident[0] or not[1]: 1
Want a parking decal? [y/n]: y
Want an AS sticker? [y/n]: y
Want an ID card? [y/n]: y
For Winter semester, your total fees are $ 2042.50

SMC Fee Calculator
Enter number of units enrolled: 18
Is this Fall[0], Winter[1], Spring[2] or Summer[3] session: 2
Are you a state resident[0] or not[1]: 1
Want a parking decal? [y/n]: y
Want an AS sticker? [y/n]: y
Want an ID card? [y/n]: y
For Spring semester, your total fees are $ 5985.50

Enrollment Fee

$ 46.00/ unit for California Residents
$ 325.00/ unit for F1/Non-Residents

Student Services Fee
(AS Sticker fee is Optional, saving $19.50)
(ID Card fee is Optional, saving $13)

$ 47.50 Winter/Summer
$ 50.50 Fall/Spring

Parking Decal (Optional)

$ 45.00 Winter/Summer
$ 85.00 Fall/Spring

Explanation / Answer

void main()
{
int units,seasons;
int opt;
double fees=0;
cout<<"press 0 for fall,1 for winter , 2 for spring and 3 for Summer "<<endl;
cin>>season;
switch(season)
{
case 0:
label1:
cout<<"are you a state resident??press 1 for yes and 2 for no"<<endl;
cin>>opt;
if(opt==1)
{
fees=46;
}
else if(opt==2)
{
fees=295;
}
else
{
cout<<"invalid input please enter again"<<endl;
goto label1;
}

label2:
cout<<"want a parking decal?? , press 1 for yes and 2 for no "<<endl;
cin>>opt2;
if(opt2==1)
{
fees=fees+85;
}
else if(opt2==2)
{
}
else
{
cout<<"invalid input,please enter again"<<endl;
goto label2;
}

label4:
cout<<"Want an AS sticker? press 1 for yes and 2 for no"<<endl;
cin>>opt3;
if(opt3==1)
{
fees=fees+19.50;
}
else if(opt3==2)
{
fees=fees;
}
else
{
cout<<"invalid input please enter again"<<endl;
goto label4;
}

label5:
cout<<"want an ID card?? press 1 for yes and 2 for no"<<endl;
cin>>opt4;
if(opt4==1)
{
fees+=13;
}
else if(opt4==2)
{
}
else
{
cout<<"invalid input!! please enter again."<<endl;
goto label5;
}
cout<<"enter the number of students enrolled"<<endl;
cin>>students;
fees= students * (fees+50.50);
cout<<"for fall semester, total fees = "<<fees;
break;

case 1:
case 2:
case 3:
default:
}