WilhelmiQuiz2 - Wilhelmi, John-Paul Professor Kennedy C+...

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

View Full Document Right Arrow Icon
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)
Background image of page 1

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

View Full DocumentRight Arrow Icon
{ 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 .
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

WilhelmiQuiz2 - Wilhelmi, John-Paul Professor Kennedy C+...

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

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