Ch. 3 Computer Science

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

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

Page1 / 2

Ch. 3 Computer Science - 17. cout &amp;amp;lt;&amp;amp;lt;...

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