Question: TASK 1 Convert the code in Figure 1 into switch statement. string age; int newage; Console.WriteLine ( Enter age : ) ; age

TASK 1
Convert the code in Figure 1 into switch statement.
string age;
int newage;
Console.WriteLine("Enter age : ");
age = Console.ReadLine();
newage = Convert.ToInt32(age);
if(newage 13)
{
Console.WriteLine("You are child");
}
else if(newage >=13 && newage 20)
{
Console.WriteLine("You are teenager");
}
else if (newage >=20 && newage 60)
{
Console.WriteLine("You are adult");
}
else
{
Console.WriteLine("You are senior");
}
Figure 1
Plz answer this question ASAP i really need it.Thank you so much for help me.
TASK 1 Convert the code in Figure 1 into switch

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 Programming Questions!