473,671 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

16 New Member
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 3214
weaknessforcats
9,208 Recognized Expert Moderator Expert
And your question is...??
Apr 24 '07 #2
Greatness
16 New Member
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 Recognized Expert Top Contributor
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,ope rations 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
Greatness
16 New Member
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 Recognized Expert Top Contributor
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.Th ey 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
Greatness
16 New Member
Ok i so will i need to use a functions in this program???
Apr 24 '07 #7
Savage
1,764 Recognized Expert Top Contributor
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
2098
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/ Under linux I built tile from source, installed and it just works. import Tkinter root = Tkinter.Tk() root.tk.call('package', 'require', 'tile')
7
4535
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, Harlin
21
20628
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. http://www.officeactivate.com/web-site-design.shtml Any ideas? thanks.
5
1356
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 any research into the ratio between time taken to produce an estimate and the accuracy of an estimate? Could it be said for example that if the programmer had spent 8 hours on the estimate he would have been more likely to have arrived at 15 days?
1
1605
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: http://mfranklin.is-a-geek.org/docs/Tile/index.html That server seems to be down. Anyone know if the wrapper is available elsewhere? Or if someone else has written a Tile wrapper? --
0
1258
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: http://tktable.sourceforge.net/tile It's in the process of going into the Tk core, so it will be available with Tk 8.5 with no additional libraries required.
2
5373
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 because the Tk widget library, that Tkinter uses, defaults to looking like Motif, which hasn't been the default widget set of *anything* for a long time. The Tk folks are apparently getting their act together. Tile is a "theming engine" for Tk with...
14
4275
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 specify things like the size of the margins and formats for titles, paragraphs, references, page numbers, etc. Suppose that a program is to produce a report conforming to a standard. It would be desirable to provide utility class to automatically conform...
4
3975
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 see what's new in the Gui department. I started using Tkinter several years ago and have a lot of stuff written in it. As a result, it's hard to switch to another interface (wxPython, PyQt, etc) with all the hours it would take to reproduce...
0
8397
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8919
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8821
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8670
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7439
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6230
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2813
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.