Okay, the teacher is giving me extended time, since I'm eligible for it.
I seem to have a nice and clean code going, I'm just one step away, therefore, there is just one problem.
The program isn't calculating and multiplying the applicant's age by $600 if they don't have a college degree. It seems to be ignoring the SMWO constant integer, with a value of $600.
BTW, my professor does not want us to define like this:
const double ADULT = 18;
const double SMWD = 1000.0;
const double SMWO = 600.0;
He'd rather us use #define ADULT 18, since it is a float, or else we'll get points taken off for it.
Here is my code...
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
|
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
int AGE, DEGS;
#define ADULT 18 //Age (integer)
#define SMWD 1000.0 //Salary (float) Multiplier with degree
#define SMWO 600.0 //Salary (float) Multiplier without degree
system("CLS"); //Clear the Screen
cout << "Applicant Screen Test Program \n\n";
cout << "Welcome! \n\n";
cout << "What is your age in years? ";
cin >> AGE;
if (AGE >= ADULT)
{
cout <<"Do you have a college degree (Y/N)? ";
cin >> DEGS;
if (DEGS == 'Y' || 'y')
{ cout << "Congratulations! You qualify for the job!\n";
cout << "Your calculated annual salary is: $" << setprecision (2) << fixed << AGE * SMWD << endl;
cout << "Please fill out an application at the front desk.";
}
else
{ cout << "Congratulations! You qualify for the job!\n";
cout << "Your calculated annual salary is: $" << setprecision (2) << fixed << AGE * SMWO << endl;
cout << "Please fill out an application at the front desk.";
}
}
else
{ cout << "We're sorry, you do not qualify for the job. \n";
cout << "You must be " << ADULT << " or older.\n";
cout << "Please reapply when you're old enough, in " << ADULT-AGE << endl; cout << "years.\n";
cout << "Thank you for your interest!";
}
return (0);}
|
I just need this figured out, and I should be good to go.
Why won't the program multiply $600? The expression/instruction I put in (AGE * SMWO) seems pretty clear?