Chapter 3 homework

Chapter 3 homework - e. You need a <<...

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

View Full Document Right Arrow Icon
Daniel E. Fore def45 Ms. Lisa G. Henderson CSE-1284-01 05 September 2007 Chapter3 Homework Pages 147 – 152 #’s 4, 5, 7 – 16, 31 - 34, 38
Background image of page 1

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

View Full DocumentRight Arrow Icon
4. cin >> age, pay, section; 5. #include <iostream> 7. A. price = 12 * unitCost; B. cout << setw(12) << 98.7; C. cout << 12; 8. 5 22 20 6 46 30 0 3 16 9. a= 12 * x z= (5*x) + (14*y) + (6*k) y= pow(x, 4) g= (h + 12) / (4*k) c= pow(a, 3) / [ pow(b,2)*pow(k,4)] 10. c
Background image of page 2
11. a 12. unitsEach = static_cast<int> (qty) / salesReps; 13. int constantRate; 14. x+= 5; total += subtotal; dist /= rep; ppl *= period; num %= 2; 15. east=west=north=south=1; 16. cout << setprecision(2) << endl; cout << "divSales: " << stew(8) << divSales << endl; 31. a. They forgot the #include <iostream> b. You don’t need to capitalize the c in cout and cin c. Your cin statements need a >> not << d. Your sum statements should be: sum = number1 + number2;
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e. You need a &lt;&lt; after the last sum and also a endl; at the end also 32. a. The cin statement needs to be: cin&gt;&gt; number1 &gt;&gt; number2; b. The quotient statement doesnt need a type cast expression; it needs to read: quotient = number1 / number2; c. The last cout statement needs &lt;&lt; endl; after quotient 33. a. You do not need the const infront of the int statement b. The last cout statement needs &lt;&lt; endl; at the end 34. a. You need a int infront of the main and () after the main b. You need a ; after your first 2 cout statements c. Number1 =* 50; needs to be: number1 *= 50; d. Number2 =* 50; needs to be; number2 *= 50; e. The last cout statement needs &lt;&lt;endl; at the end 38. 13 11 12...
View Full Document

Page1 / 4

Chapter 3 homework - e. You need a &amp;amp;lt;&amp;amp;lt;...

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

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