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 16E
Program Plan Intro

Program Plan:

Following variables are used in the program:

Month: It is the enumeration that stores the months and their respective integer values.

stringMon: Enumeration type to store the name of month.

intMonth: To store the integer value of month.

UserInput: To take input from user in string format.

Following functions are used in the program:

Console.ReadLine(): To input month value in string format.

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

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

Summary Introduction:

Program will use define an enumeration Month which will store the month name and its respective integer value. Then Main() method will be used to ask the user to input the integer value of any month. The entered value will be stored in a variable type of Month enumeration after typecasting and name of month will be provided to the user. Program Description:

Purpose of the program asks user to input an integer number within range of 1 to 12 and provide respective month name for the integer.

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.
Input a value for the variable y so that the variable x becomes 4 after the code executes. favorite_numbers = y favorite_numbers.remove(-1) x = len(favorite_numbers)
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, the 405 services the 5, and the 290 services the 90. Your program will prompt the user to type a highway number ("Please enter a highway number, Ex: 65: "), read in the number typed by the user, and print out whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also your program must indicate if the (primary) highway runs north/south or east/west, that it is an invalid number if not between 0 and 999. Ex: If the input is: 90 the output is: The 90 is primary, going east/west. Ex: If the input is: 290 the output is: The 290 is auxiliary, serving the 90, going east/west. Ex: If the input is: 0 the output is: 0 is not a valid interstate highway number. #include <iostream>using…

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
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT