Lee_assig5 - cout<< "Your raise: "...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> #include <cmath> using namespace std int main() { int choice cout<<"What would you like to do? choose 1, 2,,3or 4:\n" cout<<"+-------------------------------------------+\n" cout<<"| 1. Using Payroll Program |\n" cout<<"| 2. Taking a quiz |\n" cout<<"| 3. Find Your Letter Grade |\n" cout<<"| 4. Exit |\n" cout<<"+-------------------------------------------+\n" cin>>choice switch (choice){ case 1: if(choice==2){ double salary, raise, Nsalary cout<< "You have chosen the Payroll Program." <<endl cout<< "Input your current salary: " cin>> salary if(salary>=12752) raise= salary/21.9 Nsalary= salary+raise cout<< "Current salary: " <<salary <<endl cout<< "Your raise: " <<raise <<endl cout<< "Your new salary: " <<Nsalary <<endl } else if(salary<12752) raise= salary/17.6 Nsalary= salary+raise cout<< "Current salary: " <<salary <<endl cout<< "Your raise: " <<raise <<endl cout<< "Your new salary: " <<Nsalary <<endl else if(salary<9500) raise= salary/15.2 Nsalary= salary+raise cout<< "Current salary: " <<salary <<endl
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout<< "Your raise: " <<raise <<endl cout<< "Your new salary: " <<Nsalary <<endl } break case 2: int q,p cout<<"You have chosen the Quiz Mode: "<<endl cout<<"How Many States are in the United States? "<<endl cin>>q cout<<"Correct!!"<<q==50<<endl cout<<"Who is the current President?"<<endl cin>>p cout<<"Correct!!"<<p==barackObama<<endl break case 3: Sheet1 Page 2 int percent,letterGrade cout<<"You have chose to Find Your Letter Grade: "<<endl cout<<"Please Enter Your Percentage: "<<endl cin>>percent letterGrade==A if(letterGrade<=89%) letterGrade=B if(letterGrade<=79%) letterGrade==C if(letterGrade<=69%) letterGrade==D if(letterGrade<=59%) lettergrade==F cout<<"Your Letter Grade is: "<<letterGrade<<endl else if (percent==negative) int negative cout<<"Invalid Test Score"<<endl cin>>negative break case 4: cout<<"You choose to exit the program. Bye!"<<endl break default: cout<<"Invalid input, you must enter 1, 2 or 3"<<endl } return 0 }...
View Full Document

This note was uploaded on 05/16/2010 for the course CISCO EST61 taught by Professor Miller during the Spring '10 term at Fresno City College.

Page1 / 2

Lee_assig5 - cout<< "Your raise: "...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online