Microsoft Visual C#
Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
bartleby

Concept explainers

Question
Book Icon
Chapter 2, Problem 17E
Program Plan Intro

Program Plan:

Following variables are used in the program:

Planet: It is the enumeration that stores the planet name and their respective position values.

stringMon: Enumeration type to store the name of month.

planetPosition: To store the position value of the planet.

userInput: To take input from user in string format.

Following functions are used in the program:

Console.ReadLine(): To input position value of the planet in string format.

Convert.ToInt32(): To convert the entered value in string format to integer format.

Console.WriteLine(): To display the name of planet entered by the user and other instructions to user.

Summary Introduction:

Program will define an enumeration Planet which will store the planet name and its respective position value in the solar system. Then Main() method will be used to ask the user to input the position value of any planet. The entered value will be stored after typecasting in a variable type of Planet enumeration, and the name of the planet will be provided to the user.

Program Description:

Purpose of the program is prompted to the user to input an integer number within range of 1 to 8 describing the position of planet and provide respective planet name for the integer value.

Blurred answer
Students have asked these similar questions
ShowCurrentTime.py, gives a program that displays the current time in GMT. Revise the program so that it prompts the user to enter the time zone in hours away from (offset to) GMT and displays the time in the specified time zone.
XYZ Company, LLC uses a program to manage the information of their employees. The program gets the name of the employee, number of hours worked and rate per hour. It computes the salary by multiplying the number of hours worked with rate per hour. If the salary is more than 1000, tax is computed as 5% of the salary, otherwise, tax is computed as 2% of the salary. The program will display the name of the employee, salary and tax.
Function for button "Publishing Date": • Name this function by your last name (for example, function yamoutl)). When the user clicks on the button "Publishing Date" (after filling all the textboxes), the current date and time will be printed after the text "Published on:" CSCI375 Grades Exam-1 (70 Exam-2 98 Project 86 Exam-3 80 Show the Grades Your Grades: Exam-1 - 78, Exam-2 - 98, Project - 85, Exam-3 - 80 Publishing Date Published on: 5/10/2021, 5:39:08 PM Change Background Color

Chapter 2 Solutions

Microsoft Visual C#

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT