{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Ch06_Questions - C Programming From Problem Analysis to...

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

View Full Document Right Arrow Icon
C# Programming: From Problem Analysis to Program Design , 2nd edition ISBN 1423901460 Chapter 5 1. d. to allow statements to be repeated 2. b. 1000 3. a. foreach 4. d. do…while 5. b. for 6. d. continue 7. b. while (counter < 10) 8. a. for (num = 0; num < 10; num++) 9. d. 2 10. c. Computes the sum of even integers from1 through n 11. b. n < 10 12. a. 0 13. e. a and c above 14. d. curly braces 15. d. five times Doyle: C#, 2nd edition ISBN 1423901460    Page 1-1
Image of page 1

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

View Full Document Right Arrow Icon
16. c. the number of negative items entered 17. a. counter controlled loop 18. a. 20 19. b. 6 20. d. an infinite loop 21. for (int counter = 100; counter > 0; counter--) { Console.WriteLine(counter); } int counter = 100; // while example while (counter > 0) { Console.WriteLine(counter); counter--; } Final result is the same for all three loop constructs. Both the for statement and the while statement are tested before entry into the loop. 22. for (int val = 10; val < 101; val += 3) Doyle: C#, 2nd edition ISBN 1423901460    Page 1-2
Image of page 2
{ Console.WriteLine(val); } 23. int temp = 0; int totalTemp = 0; int tempCount = 0; double averageTemp; string inValue; Console.WriteLine(“You may enter any number of temperatures.”);
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern