C#!! simplest form to enter into the mindtap website Programming Exercise 7-2 Du
ID: 3739115 • Letter: C
Question
C#!! simplest form to enter into the mindtap website
Programming Exercise 7-2 Due on Mar 29 at 11:59 PM CDT +PaintingEstimate.cs Instructions 1 using System; 2 using static System.Console; 3 class PaintingEstimate 4 5static void Main 6 7 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. // Write your main here. 9 10 public static double ComputeCost(int length, int width) // Write your ComputeCost method here. 12 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
using System;
class PaintingEstimate {
public static void Main () {
int length, width;
Console.Write("Enter length: ");
length = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter width: ");
width = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(ComputeCost(length, width));
}
public static double ComputeCost(int length, int width) {
return 6 * ((4 * (length + width)) + (9 * (length + width)));
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.