Search : in
By :

If else loop involving less than

simplyscottif, on Sep 24, 2009 7:10:24 pm BST 
 Report this message to moderators

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

Best answers for « if else loop involving less than » in :
[C language]Checking whether an integer is a prime number Show[C language]Checking whether an integer is a prime number Definition of a prime number Algorithm 1: dividers between 2 and N-1 will be tested Algorithm 2: Even dividers will not be tested, research is limited to odd dividers Algorithm 3:...
[Myth] aMSN allows you to know if someone has blocked you on WLM ShowaMSN allows you to know if someone has blocked you on Windows Live Messenger Myth Reality Explanations Myth aMSN software allows us to know who blocked us on Windows Live Messenger. Reality FALSE Explanations When it was launched,...
What to do if a file cannot be deleted ShowWhat to do if a file cannot be deleted How to get rid of the file? Solution 1: Ensure that the file/folder is not in use Solution 2: Run your system on Safe Mode Solution 3: Download or update your Antivirus program Solution 4: Use...
ADSL - Local loop unbundling ShowIntroduction to local loop unbundling The part of the telephone line arriving at the subscriber is called the "local loop". In order to use high speed internet (ADSL), Internet Service Providers (ISP) must install connection hardware to their...
Partition - Partitioning a hard drive ShowWhat is a partition? The partitioning of a hard drive occurs after the drive has been physically formatted but before it is logically formatted. It involves creating areas on the disk where data will not be mixed. It can be used, for example, to...
Operating Systems - MS-DOS - Tips ShowSetting the CD-ROM drive The CD-ROM drive is configured in the config.sys and autoexec.bat system files. The CD-ROM drive device driver must be configured in the config.sys file (even if the device is automatically detected in Windows). To do...