Create a Console application named FirstNameLastName5CA Save the application in the FirstInitialLastnameCSUnit5C folder. Create a program in which the Main() method prompts a user for length and width of a room in feet. Create a method called ComputeCost*( that accepts the values and then computes the cost of painting the room. Use a constant value of 9 for the height. Assume the room to be rectangular with four full walls and 9-foot ceilings. The price of the job is $6 per square foot. Return the price to the Main() method, and display it as shown in the example. An example of the program is shown below: Enter length of the room in feet >> 30 Enter width of room in feet >> 16 Cost of job for 30 X 16 foot room is $4,968.00 In order to add the $ to currency values, the program will need to use the CultureInfo.GetCultureInfo method. In order to do this, include the statement using System.Globalization; at the top of your program and format the output statements using the following example: WriteLine("This is an example: {0}", value.ToString("C", CultureInfo.GetCultureInfo("en-US"))); Program #2 Create a Console application named FirstNameLastName5CB Save the application in the FirstInitialLastnameCSUnit5C folder. Create an application whose Main() method prompts a user for a number of miles. Pass the value to a method called ConvertToKilos() that converts the value to kilometers Return the value to the Main() method where it is displayed as shown below
Hello I need help with these two C# programs.
Program #1
Create a Console application named FirstNameLastName5CA
Save the application in the FirstInitialLastnameCSUnit5C folder.
Create a program in which the Main() method prompts a user for length and width of a room in feet.
- Create a method called ComputeCost*( that accepts the values and then computes the cost of painting the room.
- Use a constant value of 9 for the height.
- Assume the room to be rectangular with four full walls and 9-foot ceilings.
- The price of the job is $6 per square foot.
- Return the price to the Main() method, and display it as shown in the example.
An example of the program is shown below:
Enter length of the room in feet >> 30
Enter width of room in feet >> 16
Cost of job for 30 X 16 foot room is $4,968.00
In order to add the $ to currency values, the program will need to use the CultureInfo.GetCultureInfo method.
In order to do this, include the statement using System.Globalization; at the top of your program and format the output statements using the following example: WriteLine("This is an example: {0}", value.ToString("C", CultureInfo.GetCultureInfo("en-US")));
Program #2
Create a Console application named FirstNameLastName5CB
Save the application in the FirstInitialLastnameCSUnit5C folder.
Create an application whose Main() method prompts a user for a number of miles.
- Pass the value to a method called ConvertToKilos() that converts the value to kilometers
- Return the value to the Main() method where it is displayed as shown below.
1 mile is 1.60934 kilometers.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images