Question: This lab will reinforce topics covered in the Methods lectures. Create a program called Lab 6 . At the top of the Program.cs file, you

This lab will reinforce topics covered in the Methods lectures. Create a program called Lab6. At the top of the Program.cs file, you will do the method calls of the 4 methods you are asked to create below. The 4 methods below should be created in the same Program.cs, below the method calls.
Method 0: Menu
Create a menu that lets a user select which method to run.
The menu should display a number and the name of the function to run.
The user should be able to enter an input validated number.
Use if-statements or a switch-statement to determine which method to call, then call the appropriate method.
Loop the main method to repeated display the menu after each method is used.
If the user enters a 9, then the loop should stop and the program should end.
Method 1: Show Character
Write a method named ShowCharacter. This method should accept two arguments: a reference to a string object and an integer. The integer argument is a character position within the string, with the first character being 1. When the method executes, it should display the character at that position. (The position is a human position and not a computer science position.)
Example:
ShowCharacter(New York,2);
//this would display the letter e
Method 2: Retail Price
Write a method that asks the user to enter an items wholesale cost and its markup percentage. It should then display the items retail price. For example:
If an items wholesale cost is 5.00 and its markup percentage is 100 percent, then the items retail price is 10.00.
If an items wholesale cost is 5.00 and its markup percentage is 50 percent, then the items retail price is 7.50.
The method is named CalculateRetail receives the wholesale cost and the markup percentage as arguments and returns the retail price of that item.
Method 3: Temperature Table
The formula for converting a temperature from Fahrenheit to Celsius is listed below:
C =5/9(F -32)
F is the Fahrenheit temperature, and C is the Celsius temperature. Write a method named Celsius that accepts a Fahrenheit temperature as an argument. The method should return the temperature, converted to Celsius.
Demonstrate the method by calling it in a loop that displays a table of the Fahrenheit temperatures 80 through 100 and their celsius equivalents.
Method 4: Prime Numbers
A prime number is a number that is evenly divisible only by itself and 1. For example, the number 5 is prime because it can be evenly divided only by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1,2,3, and 6.
Write a method named IsPrime, which takes an integer as an argument and returns true if the argument is a prime number or false otherwise. Demonstrate the method in a complete program.
Method 5: Simple Adding Machine
Write a program that contains a do-while loop that lets a user enter two numbers. The number should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise, it should terminate.
Create a method that prompts for an integer and enters an input validation loop (using TryParse) until a valid integer is entered. The method should return the integer.
Create a method that accepts to integers and returns their sum.
Be sure to comment your code as necessary and test your program. Ensure that the final grade is correct. Ensure that each letter grade displays correctly.
Method 6: Pyramid
Write a program that will ask the user to enter the height of a pyramid. Use your knowledge of loops to display a pyramid of that height.
Is positive
Is less than 50.
Create a method to validate the above.
Create a void method to display the pyramid.
See example output below:
Pyramid Height: 5
*
**
***
****
*****

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!