ToLower if initial d initial e initial f Write Enter sales amount double

# Tolower if initial d initial e initial f write enter

This preview shows page 5 - 6 out of 6 pages.

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( "\nDanielle's Amount: {0:c}" + "\nEdward's Amount: {1:c}" + "\nFrancis' Amount: {2:c}" + "\n\nGrand Total: {3:c}" , dAmount, eAmount, fAmount, grandTotal); c. For Loop (Page 220 #8) public class OddNums { public static void Main() {
Console.WriteLine( "Odd numbers from 1 to 99." ); for ( int n = 1; n < (99 + 1); n++) // iterating from 1 to 99 { if (n % 2 != 0) //checking the condition for odd numbers { Console.WriteLine(n.ToString()); // For printing } } } }

#### You've reached the end of your free preview.

Want to read all 6 pages?

• Spring '10
• NEWBY

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern