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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  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.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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