473,396 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Program that estimates the number of boxes of tile for a job

Ceramic Floor Tile
You’re working for a company that lays ceramic floor tile, and they need a program that estimates the number of boxes of tile for a job. A job is estimated by taking the dimensions of each room in feet and inches, and converting these dimensions into 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 input. It should then input the dimensions for each room, and output the tiles needed for that room. After the last room is input, the program also should output the total number of tiles needed, the number of boxes needed, and how many extra tiles will be left over.

Here is an example of how a run might appear:

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 the 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 tiles 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 non-positive dimensions, number of rooms less than one, number of inches greater than 11, and so on. It should prompt for corrected input whenever invalid input is detected. Now that your programs are becoming more complex, it is even more important for you to use proper indentation and style, meaningful identifiers, and appropriate comments.
Apr 24 '07 #1
7 3196
weaknessforcats
9,208 Expert Mod 8TB
And your question is...??
Apr 24 '07 #2
Anyone has any suggestions on how to start the this???
I missed the class when she went over this....
Apr 24 '07 #3
Savage
1,764 Expert 1GB
I missed the class when she went over this....

How dare u?(Just kiding)

Now to the point:

Let us analize it first:

As any program it's composed of 3 vital parts:input,operations over data output.
To break logic of any program we use functions.So primarly u need to create a
struct,fill it up with data and then return it from function that u created for inputing data.

When u have done this or if u are still stucked let us know!!

Savage
Apr 24 '07 #4
Stuck.

I really dont know functions at all. My teacher really went over it and like a swift wind and i still looking like "huh?!?!?!".
Apr 24 '07 #5
Savage
1,764 Expert 1GB
Stuck.

I really dont know functions at all. My teacher really went over it and like a swift wind and i still looking like "huh?!?!?!".

OK,let us start step by step:

Functions are like subprogrames.They allow you to call some earlyer created process bunch of times.

And here are some basics(for now):

1.How to create function?

First before main( ) we have a function
Expand|Select|Wrap|Line Numbers
  1. definition
process which is often commented like //Function prototypes.In main we are making a function caller and after the main we are declaring function.

Now to example: ("Example is more powerful than precept" - Aesop")

//headers.h

//Function prototypes.

void number(void);

//main();
number();

//end main();

//Function declarations

void number(void)
{
int n=15;
//print out number
}

If u get this post agaiun so that we can move to more advanced functions.
Savage
Apr 24 '07 #6
Ok i so will i need to use a functions in this program???
Apr 24 '07 #7
Savage
1,764 Expert 1GB
Yup.See post #4.

Savage
Apr 24 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Stephen Kennedy | last post by:
I've been trying to get Tile to work with python. It can make your tkinter apps look like http://tktable.sourceforge.net/tile/screenshots/demo-alt-unix.png See http://tktable.sourceforge.net/tile/...
7
by: Harlin Seritt | last post by:
I was looking at the Tcl/Tk sourceforge page and found that there were a couple of new widgets being produced for Tcl 8.5. Does anyone know if there are any Tkinter wrappers somewhere? thanks, ...
21
by: Dan V. | last post by:
I have tried a number of things including preloading, but the background image (water tile in header) in IE 6 will not display where other browsers will....
5
by: Jason Madison | last post by:
A programmer I work with spent 4 hours producing a 14 day estimate for a project. In the event the project took 15 days and his manager was annoyed that he had estimated incorrectly. Is there...
1
by: Kevin Walzer | last post by:
I believe Martin Franklin wrote a Tile.py wrapper for the Tk/Tile extension, which adds theming to the core Tk widget set. It used to reside here: ...
0
by: Kevin Walzer | last post by:
Is anyone using Tile in their Tkinter applications? Tile provides native theming for Windows XP and Mac OS X, and provides an improved Tk look-and-feel on Unix/Linux. For info on Tile:...
2
by: Ben Finney | last post by:
Howdy all, Python programmers looking for a built-in GUI toolkit are told two things: one, Python already comes with a GUI toolkit, and two, it looks equally ugly on all platforms. This is...
14
by: wshaer | last post by:
Hi all, I have an assignment and I need some help with it. This is the assignment // Research reports are often required to conform to a given standard such as APA or MLA. These standards...
4
by: Mudcat | last post by:
So I haven't programmed much in Python the past couple of years and have been catching up the last few days by reading the boards. I'll be making commercial Python applications again and wanted to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.