473,386 Members | 1,958 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,386 software developers and data experts.

Simple program question

Do programming exercise 3, calculating cost of lumber. There is an example given with regard to how to calculate board feet, but let me clarify the example by giving the details of the calculation. As stated, a board foot equals one square foot, one inch thick. A 2 x 4 x 8 board, which is 2 inches thick, 4 inches wide and 8 feet long, is 5.333 board feet. To calculate this, we do the following: the board is four inches wide, which is 4./12. of a foot. Thus the board contains (4./12.) * 8 square feet. Since the board is two inches thick, we must multiply the square feet by 2 to obtain the board feet. The number of board feet is hence calculated to be 2. * (4./12.) * 8., or 5.333. You should use at least two functions other than main -- one to calculate the cost of a set of lumber when given the type of lumber, the number of boards, and the dimensions of a board, and another to obtain the input from the user. You should check the input to make sure that a valid type of lumber is entered, and continue to prompt the user until a correct type is given. Note that if an invalid type is entered, the prompt must give a list of valid types.


This is due really soon.....any help would be greatly appreciated!
Dec 5 '07 #1
1 1348
numberwhun
3,509 Expert Mod 2GB
Do programming exercise 3, calculating cost of lumber. There is an example given with regard to how to calculate board feet, but let me clarify the example by giving the details of the calculation. As stated, a board foot equals one square foot, one inch thick. A 2 x 4 x 8 board, which is 2 inches thick, 4 inches wide and 8 feet long, is 5.333 board feet. To calculate this, we do the following: the board is four inches wide, which is 4./12. of a foot. Thus the board contains (4./12.) * 8 square feet. Since the board is two inches thick, we must multiply the square feet by 2 to obtain the board feet. The number of board feet is hence calculated to be 2. * (4./12.) * 8., or 5.333. You should use at least two functions other than main -- one to calculate the cost of a set of lumber when given the type of lumber, the number of boards, and the dimensions of a board, and another to obtain the input from the user. You should check the input to make sure that a valid type of lumber is entered, and continue to prompt the user until a correct type is given. Note that if an invalid type is entered, the prompt must give a list of valid types.


This is due really soon.....any help would be greatly appreciated!
Really? Its due really soon?!? Well then, I would highly suggest you get busy on it. You see, it is against TSDN Posting Guidelines to post school/course work and expect an answer. You will also find that your urgencies are not translated into urgencies for everyone else here.

That said, you will have to put the effort into solving your school work, sorry!

Regards,

Jeff
Dec 5 '07 #2

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

Similar topics

3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
51
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct...
10
by: serge calderara | last post by:
Dear all, I need to build a web application which will contains articles (long or short) I was wondering on what is the correct way to retrive those article on web page. In orther words, when...
1
by: c_beginner | last post by:
yes, this is my how work question. Since I am lack in getting an assistance with my lab work I put this in this advance group. Sorry for the trouble I am making. Write a program to calculate the...
4
by: pcnerd | last post by:
I originally asked this question in the "classic" VB forum. It occured to me after I had sent it that I sent it to the wrong forum. Anyway! Here's the situation. I have VB.NET 2005 Express...
41
by: SkyBlue | last post by:
Hi, can someone explain why the following simple C code segfaulted? I've stared it for 30mins but couldn't find the problem. Thx in advance #include <stdio.h> int main() { char *one; char...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
10
by: blaine | last post by:
Hey everyone! I'm not very good with Tk, and I am using a very simple canvas to draw some pictures (this relates to that nokia screen emulator I had a post about a few days ago). Anyway, all is...
10
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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...

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.