Question: Question 1 Convert the following loop into a for loop bool keepGoing = true; int count = 0 ; while ( keepGoing && count 3
Question
Convert the following loop into a for loop
bool keepGoing true;
int count ;
whilekeepGoing && count
Console.WriteLinecount;
Console.WriteLineKeep going?";
keepGoing Convert.ToBooleanConsoleReadLine;
count ;
Question
The code in question currently has no validation. Check for the following cases:
Nonnumeric input
Negative number input
Number greater than input
If any of the validation cases are encountered, output "error" to the user. Otherw deposit amount to the user.
Question
onvert the following ifelse into a switch case:
Console.WriteLineEnter a username";
string ulnput Console.ReadLine;
if ulnput "admin"
Console.WriteLineNice try";
else if ulnput "user"
Console.WriteLineToo common!";
else if ulnput "password"
Console.WriteLineThat comes later";
else
Console.WriteLineUsername set!";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
