Answer to Question #264218 in C# for Tori

Question #264218

Write a program that prompts the user for one of four colours. Based on their input, provide back an interesting response. 


1
Expert's answer
2021-11-12T05:06:48-0500
using System;
using System.Collections.Generic;


namespace App
{
  
    class Program
    {




        static void Main(string[] args)
        {


            


            Console.Write("Enter color: ");
            string color = Console.ReadLine();


            if (color == "red") {
                Console.WriteLine("Power");
            }
            else if (color == "blue")
            {
                Console.WriteLine("Cold");
            }
            else if (color == "green")
            {
                Console.WriteLine("Earth");
            }
            else if (color == "orange")
            {
                Console.WriteLine("Health");
            }
            else {
                Console.WriteLine("Wrong color");
            }






            Console.ReadLine();
        }




    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS