Saturday, May 22, 2010

Help with C# code do loop?

Please help change this code to a complete the same tasks but using a do loop


static void Main()


{


string userin;


char selection=' ';


double beginBalance;


double newBalance;


int numChecks=0;


double checkAmount=0;


double depositAmount=0;


int numDeposits=0;


Console.Write("Please enter the beginning check-book balance: ");


userin = Console.ReadLine();


beginBalance = Convert.ToDouble(userin);


newBalance = beginBalance;


while ((selection != 'q' || selection != 'Q')%26amp;%26amp; newBalance %26gt;0)


{


Console.WriteLine("Please enter the type of transaction you would like to make?");


Console.WriteLine("Please enter the type of transaction you would like to make?");


Console.WriteLine("Transaction codes you must enter are as follows:");


Console.WriteLine("D or d Deposit");


Console.WriteLine("C or c Check");


Console.WriteLine("When you have completed entering the transactions please enter Q or q to quit");


userin = Console.ReadLine();


selection = Convert.ToChar(userin);

Help with C# code do loop?
That code is incomplete: it doesn't have a closing curly bracket for the while loop. Too long a posting?
Reply:LOL. That SURE looks like a programming CLASS question or assignment. Why don't you figure it out yourself? I haven't coded in awhile and even I could do that!


No comments:

Post a Comment