Ch. 3 Computer Science

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

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

View Full Document Right Arrow Icon
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;
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: 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

This note was uploaded on 04/03/2010 for the course CMPSC 121 taught by Professor Crawford,georgew during the Spring '07 term at Penn State.

Page1 / 2

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

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