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 Lab At the top of the Program.cs file, you will do the method calls of the methods you are asked to create below. The methods below should be created in the same Program.cs below the method calls.
Method : 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 ifstatements or a switchstatement 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 then the loop should stop and the program should end.
Method : 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 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:
ShowCharacterNew York;
this would display the letter e
Method : 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 and its markup percentage is percent, then the items retail price is
If an items wholesale cost is and its markup percentage is percent, then the items retail price is
The method is named CalculateRetail receives the wholesale cost and the markup percentage as arguments and returns the retail price of that item.
Method : Temperature Table
The formula for converting a temperature from Fahrenheit to Celsius is listed below:
C F
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 through and their celsius equivalents.
Method : Prime Numbers
A prime number is a number that is evenly divisible only by itself and For example, the number is prime because it can be evenly divided only by and The number however, is not prime because it can be divided evenly by and
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 : Simple Adding Machine
Write a program that contains a dowhile 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 : 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
Create a method to validate the above.
Create a void method to display the pyramid.
See example output below:
Pyramid Height:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
