Question: What am i doing wrong? it seems easy, but i am having troubles. i am trying to convert to a decimal format. using System; namespace

What am i doing wrong? it seems easy, but i am having troubles. i am trying to convert to a decimal format.

using System;

namespace PaintEst

{

public class PaintingEstimate

{

public static void Main(String[] args)

{ decimal price;

price = (decimal)GetCost();

Console.WriteLine(" At $6 per sqft, the price to paint this room is {1}.", price.ToString("c"));

}

public static double GetCost() decimal length; decimal width; decimal totalSquareFeet;

{

Console.Write("What is the Lenth of Wall to Paint? ");

length = Convert.ToDecimal(Console.ReadLine());

Console.Write("What is the Width of Wall to Paint? ");

width = Convert.ToDecimal(Console.ReadLine());

decimal height = 9;

decimaltotalSurfaceArea;

totalSurfaceArea = ((length + width) * 2) * height;

double costPerFt = 6;

double totalCost = costPerFt * (decimal)totalSurfaceArea;

Console.WriteLine(" Total Surface Area is {0}", totalSurfaceArea);

return (double)totalCost;

}

}

}

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!