2) Write a program(C#) that prompts the user for her home planet. Based on the user's input the...

70.2K

Verified Solution

Question

Programming

2)

Write a program(C#) that prompts the user for her home planet.Based on the

user's input the program will display the following:

Input: earth

Message: earth. You are an Earthling and you have 10 fingers

Input: VENUS

Message: VENUS. You are a Venusian and you have 12 fingers

Input: Mars

Message: Mars. You are a Martian and you have 8 fingers

any other input

Message: I am sorry I don't know of that planet

You may use either the ToUpper() or ToLower() methods

You MUST USE ONLY A SWITCH statement to solve this problem

  [For full marks you need to accept all permutationsof earth, venus

and mars]

Answer & Explanation Solved by verified expert
4.5 Ratings (638 Votes)
Just take a look at the code i have written code for your fullmarks that means this code will recognize all the permutations ofEARTH MARS VENUSi have used hashset for storing 3 planets for fasterLOOKUPtake a look at IDE code with proper indentationNow take a look at all types of inputshere is the codeusing Systemusing    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students