Imagine you've gone to work for Joe's Window and Door Company. Your first assignment is to write a Fortran 90 program to estimate the cost of building custom rectangular windows (not the Microsoft kind). The windows can be ordered with any one of three types of framing materials (wood, vinyl or aluminum), may contain one of two types of glass (standard or Low-E) and come in one of three styles (Budget, Standard or Premium). Assume wood framing currently costs $2.25/ft, vinyl framing costs $1.75/ft and aluminum framing costs $2.75/ft. Assume standard glass currently costs $2.50/ft2 and Low-E glass costs $4.25//ft2. Assume the total cost for budget windows is 1.8 times the materials costs, for standard windows is 2.0 times the materials costs and for premium windows is 2.6 times the materials costs. Note that all of these values may change in later versions of your program.
Calculate the cost of a 2.0 ft by 3.5 ft Budget vinyl framed window with Low-E glass.
Area = Width x Height = 2.0 ft x 3.5 ft = 7.0 ft2
Perimeter = 2 x Width + 2 x Height = 2 x 2.0 ft + 2 x 3.5 ft = 11.0 ft.
Glass cost = Unit cost x Area = $4.25/ft2 x 7.0 ft2 = $29.75
Frame cost = Unit cost x Perimeter = $1.75/ft x 11.0 ft = $19.25
Materials cost = Glass cost + Frame cost = $29.75 + $19.25 = $49.00
Total cost = Factor x Material costs = 1.8 x $49.00 = $88.20
Your program should be menu driven. For example, running the program should result in a dialogue like the one shown below:
|
Send comments and suggestions about this assignment to:
Dr. Charles S. Tritt
This page last updated 3/18/99