Assignment 3 Loops.docx - Assignment 3 Loops Due Tuesday(before class 2 points Remember to always answer the following questions before you start

Assignment 3 Loops.docx - Assignment 3 Loops Due...

This preview shows page 1 - 2 out of 2 pages.

Assignment 3 - Loops Due Tuesday 4/3/18 (before class) 2 points Remember to always answer the following questions before you start writing the program. 1. Multiple Choice: Pages 217 – 219 (odd) 1) D. loop 3) C. infinite loop 5) A. statements 7) B. The loop control variable is initialized, tested, and altered all in one place 9) A. once 11) C. a do loop 13) B. pretest 15) D. nested 17) B. 4 19) C. 3 2. Program problems: a. While Loop (Page 220 #2) Console.WriteLine( "Enter a number (999 to quit): " ); int n = Convert.ToInt32(Console.ReadLine()); int total = 0; while (n != 999) { total = total + n; Console.WriteLine( "Enter a number (999 to quit): " ); n = Convert.ToInt32(Console.ReadLine()); } Console.WriteLine( "Sum: " + total); b. While Loop (Page 220 #5) WriteLine( "Holiday Homes Salespeople include:\nDanielle\nEdward\nFrancis" ); string initial = "" ; //WriteLine("initial={0}" ,initial); double dAmount = 0.00; double eAmount = 0.00; double fAmount = 0.00; double grandTotal = 0.00;
Image of page 1
while
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Spring '10
  • NEWBY

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes