Ch. 3 Computer Science

Ch. 3 Computer Science - 17 cout<< setw 12<<...

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

Keary Hoffman Chapter. 3 1. A) 40 B) 39 C) No 3. A) cin >> setw( 25) >> name; B) cin. getline( name, 25); 4. cin >> age >> pay >> section >> endl; 5. iostream and iomanip 6. city(30) 7. A) price = 12 * unitCost; B) cout << setw( 12) << 98.7; C) cout << 12; 8. 5,28, 24, 5, 48, 30,10, 3, 16 9. a = 12 * x; z = 5 * x + 14 * y + 6 * k; y = pow( x, 4.0); g = ( h + 12) / ( 4 * k); c = pow( a, 3.0) / ( pow( b, 2.0) * pow( k, 4.0)); 10.int Float double 11. B 12. qty % salesReps; 13. const int rate = 12; 14. x+= 5, total += subtotal, dist /= rep, ppl *= period, inv -= shrinkage, num %= 2 15. east = west = north = south = 1; 16. cout <<setw(8)<<fixed<<setprecision(2)<< divSales;

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 17. cout << setw( 12) << fixed << setprecision( 4) << totalAge; 18. cout<< setw(12)<<fixed<<setprecision(8)<<population; 19. cos 20. sin 21. tan 22. pwr 23. fmod 24. log 25. log10 26.x^x 27. sqrt 28. <iostream> 29. . # include < iostream> using namespace std; int main() { double maxCredit, creditUsed, availableCredit; cout << " Enter the customer's maximum amount of credit: "; cin >> maxCredit; cout << " Enter the amount of credit used by the customer: "; cin >> creditUsed; availableCredit = maxCredit creditUsed; cout << " The customer's available credit is \$"; cout << availableCredit << endl; return 0;...
View Full Document

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern