Answer to Question #315006 in C++ for Rain Capisonda

Question #315006

The learners must create a C++ program using FUNCTIONS to compute the tuition fee of the students in a chosen level. The program will allow the users to choose the level and using the functions, the program will ask the values needed to compute the tuition fee. There must be two functions to compute the tuition fee for grade 7 and 8 level. Please use grade7 and grade8 as FUNCTION NAMES.

1
Expert's answer
2022-03-21T06:49:58-0400
#include<iostream>
using namespace std;
float grade7(float sum)
{	
      return sum*7;
}
float grade8(float sum)
{	
return sum*8;
}
int main(int argc, char *argv[])
{	
    int grade;
	float value;	
    float sum=0;
	cout<<"\n7 - grade 7";
	cout<<"\n8 - grade 8";
	cout<<"\nPlease, choose the level:";
	cin>>grade;
	cout<<"Please, enter the values to compute the tuition fee (0-exit program):";	
    do	
    {		
        cin>>value;		   
        if(value<=0)break;	
	    sum+=value;
	}while(true);	
    if(grade==7)	
        cout<<"the tuition fee is "<<grade7(sum);
	else if(grade==8)	
         cout<<"the tuition fee is "<<grade8(sum);}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog