Demo
New member
- Joined
- May 15, 2024
- Messages
- 3
- Reaction score
- 0
- Points
- 1
C#:
using System;
public class HelloWorld
{
public static void Main(string[] args)
{
Console.Write("Enter your name: ");
String name = Console.ReadLine();
Console.Write("Enter your age: ");
int age = Convert.ToInt32(Console.ReadLine());
// if (age >= 18 && age < 60){
// Console.Write(name + " your eligable to vote!");
// }else if (age >= 60){
// Console.Write(name + " buhay kapa ba?");
// }else{
// Console.Write(name + " your not eligable to vote!");
// }
bool go = (age >= 18);
switch(go)
{
case true:
Console.Write(name + " your eligable to vote!");
break;
case false:
Console.Write(name + " your not eligable to vote!");
break;
}
}
}
Try it Yourself
This is a mock-up problem; this is not the exact problem for tomorrow's laboratory. This is an example of what was discussed in the last meeting.