Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

we are writing a program that asks the user the enter the length and width of a room in feets and inches and then combin

we are writing a program that asks the user the enter the length and width of a room in feets and inches and then combin them and calculates the area of the room. however when my profesor gave us an example result his program combined the length in feet of 18 and length in inches of 11 and combined them to 18.11 and when I wrote my program it's giving me a result of 11.8 how can I make my program just combin the 2 numbers together.

here is how I wrote my program:

const float

LABOR_COST = 1.65,

TAX_RATE = 0.06825;

int main()

{string dash;

string name;

int custidnum;

float lenf, leni, widf , widi , carppsf, disc, incInLFT, incInWFT, discInD, totLenInFt, totWInFt, areaSqFt, totAreaSf, labor, insPr, totDisc, subTot, tax, total;

// Input Section:

cout << "Enter Customer Name : "; getline(cin, name);

cout << "Enter Customer ID Number: : "; cin >> custidnum;

cout << "Enter Length in Feet : "; cin >> lenf;

cout << "Enter Length in Inches : "; cin >> leni;

cout << "Enter Width in Feet : "; cin >> widf;

cout << "Enter Width in Inches: " ; cin >> widi;

cout << "Enter carpet Price per Square foot : "; cin >> carppsf;

cout << "Enter Percentagge of discount : "; cin >> disc;

// Processing Section:

incInLFT = leni / 12;

incInWFT = widi / 12;

discInD = disc / 100;

totLenInFt = lenf + incInLFT;

totWInFt = widf + incInWFT;

areaSqFt = totLenInFt * totWInFt;

totAreaSf = areaSqFt * carppsf;

labor = areaSqFt * LABOR_COST;

insPr = totAreaSf + labor;

totDisc = insPr * discInD;

subTot = insPr - totDisc;

tax = subTot * TAX_RATE;

total = subTot + tax;

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

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

Question What is an educational benefit trust and how is it used?

Answered: 1 week ago

Question

Question How are VEBA assets allocated when a plan terminates?

Answered: 1 week ago

Question

Question May a taxpayer roll over money from an IRA to an HSA?

Answered: 1 week ago