999 to quit int n int total 0 while n 999 total

999 to quit int n int total 0 while n 999 total

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

(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 = "";
Background image
//get zip code enteredby userzipCode = Console.ReadLine();for (int x = 0; x < zipcodes.Length; ++x){if (zipCode == zipcodes[x]){zipValid = true;temp = x;break;}}if (zipValid){Console.Write("$" + deliveryCharges[temp]);}else{Console.Write("Thecompany does not deliver to the requested zip code");}Console.ReadLine();}}}inputLength = Convert.ToDouble(inputString1);boolfound = false;for(intx = 0; x < areaCode.Length;++x){if(validAreaCode == areaCode[x]){found = true;areaCodexPerMinuteRate = perMinuteRate[x];totalCharge = areaCodexPerMinuteRate * inputLength;}}if(found){Console.WriteLine(" The call was{0} long and it will cost you {1}", inputLength,totalCharge);}elseConsole.WriteLine(" We do not support such zipcode");}}}Console.WriteLine(“Please enter sales”)Sales = Convert.ToDouble(Console.ReadLIne());While (sale != STOP){Console.Write(“Please enter sales”)Sales = Convert.ToDouble(Console.ReadLine());}Console.WriteLine(“How many hamburgers”);Hamburgers = Convert.ToInt16(Console.ReadLine);While (hamburgers != STOP){//WriteLine("initial={0}",initial);double dAmount = 0.00;double eAmount = 0.00;double fAmount = 0.00;double grandTotal = 0.00;while (initial != "z"){Write("\nEnter a salesperson's first initial: ");initial = ReadLine().ToLower();if (initial == "d" ||initial == "e" || initial == "f"){Write("Enter sales amount: ");double salesAmount = Convert.ToDouble(ReadLine());if (initial == "d")dAmount += salesAmount;else if (initial == "e")eAmount += salesAmount;else if (initial == "f")fAmount += salesAmount;grandTotal = dAmount + eAmount + fAmount;}}WriteLine(
Background image

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