Assignment 3a
Do not attempt this assignment until
you have worked through Lesson Four from "Where to Code" to "problem solving
part 3b
Building
Supply Company
A building Supply company needs a computer program that will help them estimate their pipe sales to contractors for each home installation. When contractors do the plumbing for a new home or building they always use three types of pipe. Galvanized steel pipe that costs $5.00 per foot, copper pipe which costs $10.00 per foot and PVC pipe which is 2.00 per foot. All pipe is purchased in only whole feet (no fractions). The user will input the amount of each type of pipe (all three types, one at a time). The program will calculate the amount owed for each type of pipe and provide the total owed. When the program is finished calculating they want to see the amount owed for each type of pipe and the total amount owed (no sales tax).
Test Data: I provide test data with each assignment and test. The numbers used in test data (in this assignment, the number of feet of each type of pipe) are just examples. You should use these numbers just to test your program, not to place the number in your code.
Test Data (use these examples to see if your program runs correctly):
| Example: If you input this data in your program (remember you can only input one value at a time): Amount of galvanized steel pipe : 10 feet Amount of copper pipe: 5 feet Amount of PVC pipe: 25 feet
This will be your output: |
You must do four things with the problem:
You need to do the first two steps below using notepad (Start, Programs, Accessories, Notepad) or MS Word (any version). It's best you do NOT use MS Works if you have that on your home computer. If you do use that program, be sure when you save it, you change the file type to either .rtf (rich text format) or MS Word (.doc) format.
Steps:
1. Develop a problem statement:
a. Assumptions
b. Input
c. Calculations (Make your calculations as simple as
possible, complex math (trying to do the total feet in one equation) is
impossible to debug and maintain)
d. Output
2. Write a human algorithm (step by step process for solving this problem. Remember you must make each step simple, don't try and combine steps, break everything down to it's simplest form.
3. Flow Chart: Use visual logic. With visual logic you will have to create a picture of your flowchart. Click on view, create metafile to include in word document. You can import the metafile into word. You can also just upload the visual logic file and leave it out of the word document.
4. Create the VB Script that will solve this problem. You should use html kit (see the lesson "Where to code"). Be sure to save the file with the .htm extension. DO NOT Use notepad for your code, use html kit instead. Do not include your code in the word document with your problem statement and human algorithm.
When you output the currency values using the formatcurrency() function (ie formatcurrency(gsteeltotal) ) to get the correct format. Also, make sure that you separate each output so they are each on their own line as such
Document.write "The total galvanized steel is " &
formatcurrency(gsteeltotal)
document.write "<p>The total copper is " & formatcurrency(coppertotal)