Hello,
I am trying to write a program that will sort out accepts and rejects using a gpa and test score. for some reason the program is always outputting reject....any ideas?
// Admission.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include<iostream>// holds the cin and cout commands
#include<conio.h>// holds the getche() instruction
//Note instead of getche() you can use the line : system(“pause”);
//Instead of the cls() defined below you can use the line: system(“pause”);
// to use the two lines above, you must #include the <stdlib.h> library in the stdafx.h file*/
//clear the screen command – not used in this program but will be later
#if !defined(microsoft)
#include<stdlib.h>
#define cls() system ("cls");
#endif
void main()
{
float gpa;
int testscore;
cout<<"Please enter the student's GPA"<<endl;
cin>>gpa;
cout<<endl<<"Please enter the admission test score"<<endl;
cin>>testscore;
cout<<endl;
if(gpa >= '3.0'){
if(testscore >= '60'){
cout<<"Accept";
}
}
else {
if(testscore >= '80'){
cout<<"Accept";
}
else {
cout<<"Reject";
}
}
getche(); // necessary to hold the output for the user to read
}
Configuration: Windows Vista Firefox 3.5.3