assignment18 - == "yes")))) { cout <<...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> #include <string> using namespace std; int main () { int age, pushups; string firstname,lastname, military, sex; s cout << "What is your full name? "; cin >> firstname >> lastname; cout << "How old are you? "; cin >> age; cout << "Were you ever in the military (yes/no)? "; cin >> military; cout << "How many pushups can you do in a row? "; cin >> pushups; cout << "Are you <m>ale of <f>emale? "; cin >> sex; c if (age >=18 && sex == "m" && (age <= 30 || (age <= 35 && (pushups >=50 || military
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: == "yes")))) { cout << "Yes, "<<firstname<< " "<<lastname<< ", you may apply." << endl; } else if (age >=18 && sex == "f" && (age <= 32 || (age <= 40 && (pushups >=50 || military == "yes")))) { cout << "Yes, "<<firstname<< " "<<lastname<< ", you may apply." << endl; } else if (age <18 || age > 40 || pushups < 50 ) { cout << "Sorry, "<<firstname<< " "<<lastname<< ", you are not eligible." << endl; } }...
View Full Document

This note was uploaded on 01/11/2010 for the course CMPSC 101 taught by Professor Drobish,renee during the Summer '07 term at Penn State.

Ask a homework question - tutors are online