What's new

Welcome to ComSci.

Welcome to our Computer Science Forum! Dive into discussions, resources, and collaborations with fellow enthusiasts. Let's explore the endless possibilities of technology together!

Ask question

Ask questions and get answers from our community

Answer

Answer questions and become an expert on your topic

Contact us

Contact the site administrator directly.

Possible laboratory tommorow

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.
 
shape1
shape2
shape3
shape4
shape5
shape6
Top