Unit #7 Programming Assignment
Course Outline HW & Programming Assignments
7pa2
 

WHY DO HOT AIR BALLOONS FLY?

Properties of the US Standard Atmosphere are given in the file atmosphere.txt. For this assignment you should write a program which:

  1. Reads the data from the file into 3 arrays altit[17], temp[17], pres[17] for altitude, temperature and pressure ratio.
  2. Prompts the user for an altitude in meters ( within the range of the data) and reads the input from the screen.
  3. Using linear interpolation and the data of the two altitudes sandwiching the entered altitude, calculates and prints the temperature and pressure at the given altitude. The results must be given in both metric and English units.
  4. Produces a file ( named xxxx7parep.txt ) which lists the data given : elevation in feet, the temperature in degrees Fahrenheit, the pressure in psi and also the altitude entered and the calculated temperature and pressure all in English units.

In addition you must

  1. Import the report file to a spreadsheet and draw a chart, which shows the temperature and pressure profiles together with the two calculated points as two large red circles.
  2. Enhance your chart by titles and units and captions.

 

 

Submit a printout of your spreadsheet file that should include the Engineering 1 box and the chart you have created.

You must prepare two files with the names xxxx7pa.cpp, xxxx7parep.txt .