Concept explainers
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.
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Microsoft Visual C#
- Alert dont submit AI generated answer.arrow_forwardC Programming Language Task: Pascal's Triangle Write a program to print Pascal's triangle. In Pascal's triangle Each number is the sum of the two numbers above it. You may assume the maximum height for this task is 20. Print each character with 5 spaces of padding. e.g.printf("%5d", variable) 1 1 1 1 2 1 133 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1arrow_forwardCreate a program that calculates the total cost of a restaurant bill, including tax and tip.Explanation: First, the program should ask the user for the cost of the meal. Then, the program should ask for the tax rate (in percentage) for the meal. Next, the program should ask for the tip rate (in percentage) for the meal. The program should then calculate the total cost of the meal, including tax and tip, and display the result to the user.arrow_forward
- Create a program that calculates the total cost of a restaurant bill, including tax and tip.Explanation: First, the program should ask the user for the cost of the meal. Then, the program should ask for the tax rate (in percentage) for the meal. Next, the program should ask for the tip rate (in percentage) for the meal. The program should then calculate the total cost of the meal, including tax and tip, and display the result to the user. In c# language pleasearrow_forwardJAVA:arrow_forwardWidgets and Gizmos An online retailer sells two products: widgets and gizmos. Each widget weighs 75 grams. Each gizmo weighs 112 grams. Write a program that reads the number of widgets and the number of gizmos in an order from the user. Then your program should compute and display the total weight of the order.arrow_forward
- Create a flowchart that will ask the user to input the 10 numbers that will be stored in an array and output the Mean, Median, Largest and Smallest among the input numbers.arrow_forwardProblem: A small company needs an interactive program to compute an employee’s paycheck. The payroll clerk will initially input the data, and given the input data, an employee's wage for the week should be displayed on the screen for the payroll check. The data for the employee includes the employee's hourly pay rate and the number of hours worked that week. Wage is equal to the employee's pay rate times the number of hours worked (up to 40 hours). If the employee worked more than 40 hours, wage is equal to the employee's pay rate times 40 hours plus 1½ times the employee's pay rate times the number of hours worked above 40. Instructions: Match the action at the left-side with the correct step number at the right-side (the attached picture). Note that it may be possible to group more than one related actions in the same logical step / process without altering the essence of the algorithm. In the program flow, input and checking of hourly pay rate should come before that of the number…arrow_forwardSolve it using C++ in visual stidio 2022 at entry level please. Thank youarrow_forward
- sandbox $ + Q Search this course ?.arrow_forwardIn Python Write a program that allows the user to type in a phrase and then outputs the acronym for that phrase. Note: The acronym should be all uppercase, even if the words in the phrase are not capitalized.arrow_forwardPython Programming onlyarrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT