{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

WilhelmiQuiz2

# WilhelmiQuiz2 - Wilhelmi John-Paul Professor Kennedy C Quiz...

This preview shows pages 1–3. Sign up to view the full content.

Wilhelmi, John-Paul Professor Kennedy C++ Quiz 2 C++ Spring ‘07 1.) float score4 = 14456.642341; cout<<setprecision(3); cout<<setiosflags(ios::fixed); cout<<setiosflags(ios::showpoint); cout<<score4; cout<<"\n\n"; 2.) Yes both statements are equivalent Hello i There 3.) (a) C = 2 , D = 3 , and E = 3.25 (b) 4.) ans = 9 5.) x = 8 6.) if(sales>650) { bonus= .18 * (sales - 650) ; bonus= .04 * salary + bonus; } else { bonus = none; } 7.) if(peoplePresent == 100) { cout<<"Limit Exceeded!"; } 8.) if(peoplePresent == 100)

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

View Full Document
{ cout<<"Limit Exceeded!"; } else { if(peoplePresent>100) { cout<<"Crowd over 100 people"; } else { cout<<"Crowd under 100 people"; } } 9.) Smallest 10.) counter = counter -1; counter -= 1; --counter; 11.) Yes x is an integer for the remainder of the program. X is an integer for the remainder of the program because it is the most recent typecast. 12.) c=23 13.) n=16 14.) || 15.) Cout should be outside of body a= 10; while(a<=15) { sales=a+1; } cout<<sales; 16.) You should indent the body block of code in loops to make it easier to understand . 17.) Yes both a while loop and a for loop can be used to accomplish the same instruction.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

WilhelmiQuiz2 - Wilhelmi John-Paul Professor Kennedy C Quiz...

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

View Full Document
Ask a homework question - tutors are online