Question: Question 1 Convert the following loop into a for loop bool keepGoing = true; int count = 0 ; while ( keepGoing && count 3

Question 1
Convert the following loop into a for loop
bool keepGoing = true;
int count =0;
while(keepGoing && count 3)
{
Console.WriteLine(count);
Console.WriteLine("Keep going?");
keepGoing = Convert.ToBoolean(Console.ReadLine());
count++ ;
}
Question 2
The code in question 2 currently has no validation. Check for the following cases:
Non-numeric input
Negative number input
Number greater than 19,000,000 input
If any of the validation cases are encountered, output "error" to the user. Otherw deposit amount to the user.
Question 3
onvert the following if-else into a switch case:
Console.WriteLine("Enter a username");
string ulnput = Console.ReadLine();
if (ulnput == "admin")
Console.WriteLine("Nice try");
else if (ulnput == "user")
Console.WriteLine("Too common!");
else if (ulnput == "password")
Console.WriteLine("That comes later");
else
Console.WriteLine("Username set!");
 Question 1 Convert the following loop into a for loop bool

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!