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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started