Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

UPDATE ERRORS using System; using static System.Console; namespace Exercise1_Console { class Program { // variable declaration static int floorLength, floorWidth; static double costPerSqFt, totalMaterial, totalLabor,

UPDATE ERRORS

image text in transcribed

using System;

using static System.Console;

namespace Exercise1_Console { class Program

{ // variable declaration static int floorLength, floorWidth; static double costPerSqFt, totalMaterial, totalLabor, installTime, total; static string floorLengthString, floorWidthString, costSqFtString;

// initialize constants const double COST_PER_HOUR = 35.75; const double SQ_FT_PER_HOUR = 40.00;

static void Main(string[] args) { Console.WriteLine("Jo's Flooring Cost Estimator");

// get user input Console.Write(" Please enter the floor length: "); floorLengthString = ReadLine(); floorLength = Convert.ToInt32(floorLengthString);

Console.Write("Please enter the floor width: "); floorWidthString = ReadLine(); floorWidth = Convert.ToInt32(floorWidthString);

Console.Write("Please enter the cost per square foot for the chosen flooring: "); costSqFtString = ReadLine(); costPerSqFt = Convert.ToDouble(costSqFtString);

Console.WriteLine("--------------------");

// calculate total cost totalMaterial = floorLength * floorWidth * costPerSqFt; installTime = (floorLength * floorWidth) / SQ_FT_PER_HOUR; totalLabor = installTime * COST_PER_HOUR; total = totalLabor + totalMaterial;

// display results Console.WriteLine("For a total floor size of {0} the flooring cost is {1}", (floorLength * floorWidth), totalMaterial.ToString("C")); Console.WriteLine("It will take {0} hours to install the floor at a cost of {1}", installTime.ToString("F"), totalLabor.ToString("C")); Console.WriteLine("The total installation cost for the new floor is: {0}", total.ToString("C")); } }

// end of program

OUTPUT EA Microsoft Visual Studio Debug Console Chris Flooring Cost Estimator Please enter length of floor: 75 please enter width of floor: 15 please enter the cost per square foot for the flooring selected: 5.25 For a total floor size of 1125 the flooring cost is $5,906.25 It will take 28.13 hours to install the floor at a cost of $1,605.47 The total finished cost for the new floor is: $6,911.72

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions