Advanced Window Cost Calculator

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


Rewrite your Window cost calculation program using arrays. Your program should read frame type, glazing type (formerly glass type) and quality level (formerly style code) information from the file materials.dat. The first line in this file is a comment that should be ignored. The next line contains 3 integer values indicating the number of frame type, glazing type and quality level lines in the file. Each of the following lines contain a materials cost or quality factor (in f5.2 format), a space and a material or quality description (a character value containing up to 10 letters). A sample materials.dat file is shown in Figure 1.

Figure 1: Sample materials.dat file.

  Window material costs file.  Last updated 4/29/99.  
  4 4 4
   2.25 Wood
   1.75 Vinyl
   2.75 Aluminum
   5.25 Stainless
   2.50 Standard
   4.25 Low-E
   2.25 Acrylic
   2.75 Polycarb
   1.8  Budget
   2.0  Regular
   2.6  Premium
   3.0  Super
  

Your program should be menu driven. Running your program should result in a dialogue similar to the one shown below:

Figure 2: Advanced Window Cost Calculation program sample dialogue.

  Welcome to the Joe's Advanced Window Cost Calculator --  

  Enter window dimensions in feet (separate values with a space): 2.0 3.5  
  Enter frame type code  
  (1 = Wood, 2 = Vinyl, 3 = Aluminum, 4 = Stainless): 2  
  Enter glazing type code  
  (1 = Standard, 2 = Low-E, 3 = Acrylic, 4 = Polycarb): 2  
  Enter style code  
  (1 = Budget, 2 = Regular, 3 = Premium, 4 = Super): 1  
  The cost of this window would be: $ 88.20  

   Calculate the cost of another window (A) or quit (Q)? q
  

The lists of choices displayed by your program do not have to look quite as good as those in Figure 2, but should clearly indicate to the user what his or her choices are.

I suggest you use allocatable arrays to hold material cost and description values from the materials.dat file. I also suggest you use a subroutine to read the materials.dat file and load values into these arrays.

Suggested Test Data

I suggest you test your program with for the following windows.

  1. A 3.0 ft by 5.0 ft budget wood framed window with stndard glazing.
  2. A 3.0 ft by 5.0 ft regular vinyl framed window with Low-E glazing.
  3. A 3.0 ft by 5.0 ft premium aluminum framed window with acrylic glazing.
  4. A 3.0 ft by 5.0 ft super stainless framed window with polycarb glazing.

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