Use functional decomposition to solve

Assignment Help C/C++ Programming
Reference no: EM13164970

You're working for a company that lays ceramic floor tile, and its employees need a program that estimates the number of boxes of tile for a job. A job is estimate by taking the dimensions of each room in feet and inches, and converting these dimensions into a multiple of the tile size (rounding up any partial multiple) before multiplying to get the number of tiles for the room. A box contains 20 tiles, so the total number needed should be divided by 20 and rounded up to get the number of boxes. The tiles are assumed to be square.

The program should initially prompt the user for the size of the tile in inches and the number of rooms to be covered with tile. It should then input the dimensions for each room and output the number of tiles needed for the room. After data for the last room is input, the program should output the total number of tiles needed, the number of boxes of tile needed, and how many extra tiles will be left over.

Here is an example.

Enter number of rooms: 2
Enter size of tile in inches: 12
Enter room width (feet and inches, separated by a space): 17 4
Enter room length (feet and inches, separated by a space): 9 3
Room requires 180 tiles.
Enter room width (feet and inches, separated by a space): 11 6
Enter room length (feet and inches, separated by a space): 11 9
Room requires 144 tiles.
Total titles required is 324.
Number of boxes needed is 17.
There will be 16 extra tiles.

Use functional decomposition to solve this problem, and code the solution using functions wherever it makes sense to do so. Your program should check for invalid data such as nonpositive dimensions, number of rooms less than 1, number of inches greater than 11, and so on. It should prompt the user for corrected input whenever it detects an invalid input.

Reference no: EM13164970

Questions Cloud

What is the new pressure in the bicycle tire : A bicycle tire is filled with air to a pressure of 75. psi at a temperature of 19 degrees celcius. Riding the bike on asphalt on a hot day increases the temperature of the tire to 58 degrees celcius. The volume of the tire increases by 4.0%. What ..
Compute the ph of the buffer after the addition : Calculate the pH of the buffer after the addition of 1.5 g of HCl (36.5 g/mol). (Ka of HNO2 = 7.1x10^-4.)
Compute the net realizable value at the end of 2011 : Compute the net realizable value at the end of 20X1 and 20X2 as a percentage of respective year-end receivables balances. Analyze your findings and comment on the president s decision to close the credit evaluation department.
Matlab that will use the flipping of two-sided coins to sim : Write a program in matlab that will use the flipping of two-sided coins to simulate any event that has a probability of success(Ps) that ranges between 0 and 1. The simulation will most likely be approximate. It must be accurate to at least 0.01
Use functional decomposition to solve : Use functional decomposition to solve this problem, and code the solution using functions wherever it makes sense to do so. Your program should check for invalid data such as nonpositive dimensions, number of rooms less than 1.
What is the new water level in the cylinder : A graduated cylinder contains 110. mL of water. A 10.0 g piece of iron (density = 7.86 g/cm3) and a 18.9 g piece of lead (density = 11.3 g/cm3) are added. What is the new water level in the cylinder?
Short and long run conditions-firm shut down production : Under what conditions should a firm shut down production in the short run? Under what conditions should a firm shut down in the long run? Explain the difference between the short and long run conditions.
Draw the structure of the c4h9cl isomer : Which of the isomers of octane has only two peaks in its 13C NMR? Draw the structure of the alkane. 2. Draw the structure of the C4H9Cl isomer given the following proton NMR data:
Calculate the mass of nitrogen dissolved : Calculate the mass of nitrogen dissolved at room temperature in an 94.0 home aquarium. Assume a total pressure of 1.0 and a mole fraction for nitrogen of 0.78.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  C++ pointer function synopsis

C++ pointer Function Synopsis: char *amonthLess(char *dateString) Description: Variable dataString is a valid date in a form of mm/dd/yyyy Given the above information, write a main() program that asks a user to enter a date in a form of mm/dd/yyyy..

  A program that takes into account a pre given array

Problem: A program that takes into account a pregiven array and prompts the user to enter a return per minute value.

  The knight''s tour problem

The knight's tour problem is as follows: given an initial position for a single knight on an otherwise empty chessboard, find a sequence of 64 moves that will make the knight visit every square on the board exactly once

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Assign passed value to function to return value

Assign passed value to this member and another function to return value. Your main should read the integer from an input data file, and write the output to the output data file.

  Two types of constructors

Explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of constru..

  Include the iostream, fstream, string, and cctype libraries

1. Include the iostream, fstream, string, and cctype libraries in your program.

  Program to tell you how many months it will take to pay off

write a program to tell you how many months it will take to pay off any loan, as well as the total amount of interest paid over the life of the loan.

  Reads from the external file input.txt

Program that reads from the external file input.txt, counts the letters in every word, replaces the word by that number, and then writes the numbers to an external file output.tx

  Write a complete c++ program

The main program will read in a parameter value n (read this in main). Then it will call a function read2arrays (details below) to read lists of grades into two arrays, which the main program will call test1 and test2 (or some other names of your ..

  Whitewater high school has contracted

Whitewater High School has contracted you to write a program that will read a file of student names and test scores in the formation FIRST NAME LAST NAME: SCORE1 SCORE2 SCORE3, where each of the scores is an integer

  Problems on oops

Problems on OOPS

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd