not calculating?

when I run the program it works but is not calculating AT ALL. I know it's probably something stupid and easy I missed but I have been going nuts trying to figure out what

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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <stdio.h>    
#include <stdlib.h>   

using namespace std;


int main()



{
	
    float age; /* Applicant's age */
    char grad,Y,N; /* College degree status (Y/N) */
    float twd, twod; /*Annual Salary Offer*/
    

	
	
    #define ADULT 18            /* Age breakpoint for an adult */
    #define SMWD 1000.0         /* Salary multiplier with degree */
    #define SMWO 600.0          /* Salary multiplier without degree */
    
    
    
    
    cout << "This program will calculate your salary based on your answers. ";
    
    

    system("cls");
    
    
    

    cout << "What is your age? ";
    cin >> age;
    
	cout << "Answer the follwing question with a Y,N\n ";
    
	cout << "Did you graduate college? ";
    cin >> Y,N;
    
    
    
    if (age >= ADULT )                  //18 or over
    {
        if (grad == 'Y')         // has college degree
        {
          twd = age * SMWD;
       
          cout << "Your starting salary based on your.\n";
          cout << "input would be " << twd << "dollars. ";
        }
       else                //no college degree
       {
       	twod = age * twod;
       	cout << "Your starting salary based on your.\n";
       	cout << "input would be " << twod << "dollars. ";
       	
       }

    
    }
    else        //under 18
    {
    	cout << "Sorry you must be 18 or older to qualify. ";
    }
    
    
    
	
	
	
	
return 0;
	
}



Last edited on
I think line 45 you meant grad instead of y,n. Also the Y and N variables are doing nothing. You cant have a variable named "y,n."
also line 60 where is twod initialized? Might get some math errors there.
thanks a lot guys! yeah I fixed the y,n and it worked, but then when I hit N for college it still wouldn't work...but i got it! thanks again!
Topic archived. No new replies allowed.