MINDTAP From Cengage Programming Exercise 7-2 Due on Tomorrow at 1 1:59 PM CDT P
ID: 3738183 • Letter: M
Question
MINDTAP From Cengage Programming Exercise 7-2 Due on Tomorrow at 1 1:59 PM CDT PaintingEstimate.cs Instructions 1 using System 2 using static System.Console; 3 class PaintingEstimate 4 5static void MainO Create a program named PaintingEstimate whose Main) method prompts a user for length and width of a room in feet. Create a method that accepts the values and then computes the cost of painting the room, assuming the room is rectangular and has 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. 7 // Write your main here. 10 public static double ComputeCost(int length, int width) 12 // Write your ComputeCost method here. 13 14 GRADING As you complete the steps above, you can use the Test button to check if the lab tests are passing. Once you are satisfied with the results, use the Grade button to save your score Run Code Test GradeExplanation / Answer
Please find my Program:
using System.IO;
using System;
class Program
{
static double CostOfPaintingRoom(int length, int width)
{
int surfaceArea = length * 9 * 2 + width * 9 * 2 + length * width;
return surfaceArea * 6;
}
static void Main()
{
Console.WriteLine("Enter the length of room in feet: ");
int length = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the width of room in feet: ");
int width = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(CostOfPaintingRoom(length, width));
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.