Window Cost Calculator

Programming Assignment 1
Fortran 90 (CS-185), Fall Quarter '99, Dr. C. S. Tritt
Due 3/29


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.

Example

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:

Figure 1: Sample Window Cost Calculation program dialogue.
 
  Welcome to the Joe's Window Cost Calculator -- 
  Please enter the dimensions of the window in feet (separate values with a space) -  
  2.0 3.5
  Please enter frame type code (1 = wood, 2 = vinyl, 3 = aluminum) -
  2
  Please enter glass type code (1 = standard, 2 = Low-E) - 
  2
  Please enter style code (1 = Budget, 2 = Standard, 3 = Premium) -
  1
  The cost of this window would be: $ 88.20 Your number may look different.

Suggested Test Data

  1. The example window above.
  2. A 5.5 ft by 10.5 ft, premium wood frame window with standard glass.
  3. A 2.0 ft by 1.0 ft, standard aluminum window with Low-E glass.

Send comments and suggestions about this assignment to: Dr. Charles S. Tritt
This page last updated 3/18/99