Using default parameters

design a program that would get and validate in the main function the following input:
1) The tuition amount ( not to exceed 2000)
2)The GPA(which must be at least a 2.0). Use data validation loops. If the GPA is less than 2.0, output a message that the student doesn't quilify and end the program.

use a value-returning function named computeAID that takes two parameters, tuition and gpa. set the gpa parameter to a defualt value of 2.0 the function will calculate the amount of financial aid as follows: aid = tuition/4 * gpa. if the gpa is less than 3.0 use a function call that passes only the tuition as an argument. if the gpa is 3.0 or greater then pass two arguments, tuition, gpa.

The output would be like this.
Enter The amount of your tuition costs, not to exceed $2,000.00:500
Enter your GPA(a value between 0 and 4.0):2.0
You are entitled to receive $500 in financial aid

Enter The amount of your tuition costs, not to exceed $2,000.00:1500
Enter your GPA(a value between 0 and 4.0):4.0
You are entitled to receive $1,500 in financial aid

Enter The amount of your tuition costs, not to exceed $2,000.00:2000
Enter your GPA(a value between 0 and 4.0):3.5
You are entitled to receive $1750 in financial aid

Enter The amount of your tuition costs, not to exceed $2,000.00:1800
Enter your GPA(a value between 0 and 4.0):1.9
Sorry you do not qualify academically for financial aid.


Pls Help! :(
This is what i have so far

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main()
{
double tuition;
double gpa = 2.0;
int computeAid;


cout << "Enter the amount of your tuition costs, not to exceed $2,000.00:\n" ;
cin >> tuition;

cout << "Enter your GPA(a value between 0 and 4.0):\n";
cin >> gpa;

if (gpa >=3.0){
computeAid = tuition;

cout << "You are entitled to receive " << "$" << computeAid << " in financial aid." ;
}
else if(gpa >=2.0 && gpa < 3.0){

computeAid = (tuition / 4) * gpa;

cout << "You are entitled to receive " << "$" << computeAid << " in financial aid." ;
}
else if(gpa > 2.0){

cout << "Sorry, you do not qualify academically for financial aid
closed account (jvqpDjzh)
We don't do homework for others, if you can't do it now, study more, ask to yourself what parts of the question you don't understand. Ask specific questions!
Start by writing:
a value-returning function named computeAID that takes two parameters

Topic archived. No new replies allowed.