ENGN 38

Lab Programming Assignment #10

 

 

Problem: 

Start with your Lab #9 and add/modify it according to the following:

  

1.      Find the power produced by the engine by adding the enginePower member function then calling it appropriately.  Make sure to modify the output function to print power.

 

2.      Plot the pressure versus time (Bar Plot) by adding the barPlot member function and then calling it appropriately.  Make sure that you have clear labels for both the y and x scales, i.e. title and numeric information.  See the Example Output.

 

3.  Redefine the power and volume arrays making them dynamic arrays (using pointers).

 

To turn in:            

Print out your source code and program output making sure that the formatting is up to C++ standards and professional in appearance.  If this does not fit on one page, delete enough so that it does. (Please do not make font size less than 10 points.) What to delete? What to keep? Make sure that you at least have the header as shown in Lab#1 (your student number, your name, the class identifier, the lab number) and the output from your program. As space permits, include any other essentials as you deem appropriate. Make sure that everything is clearly labeled and easy to read and follow. Have this one page ready to turn in by the due date. 

 

 

Output Report Requirements (Note Changes)

 

Engine Analysis Report

 

Engine ID:  Megatech Mark III Model TE1   Serial Number 155

 

Analysis Date:  April 12, 2006

 

Engine Performance:        Speed                          xxxx   (RPM)

 

                                       Compression Ratio       x.x :  1

 

                                       Pressures

                                                 Maximum           xx.x    (psi)

                                                 Minimum            xx.x    (psi)

                                                 Average             xx.x    (psi)

                                               

                                       Power                          xx.xx   (watts)

 

 

 

 

 

BAR PLOT OF CYLINDER PRESSURE -VS- TIME
pressure is on horizontal axis - units are psi
time is on vertical axis - units are msec

   0.0         20.0        40.0          60.0        80.0       100.0      120.0
      +---------+---------+---------+---------+---------+---------+
  0.0|*************************
  1.5|*********************************

  3.0|*****************************************

  4.4|**************************************************

  5.9|*********************************************
  7.4|********************************
  8.9|***********************
10.4|*****************
11.9|**************
13.3|*************
14.8|************
16.3|*********
17.8|*******
19.3|******
20.7|******
22.2|*******
23.7|*******
25.2|********
26.7|********
28.1|********
29.6|********
31.1|********
32.6|********
34.1|********
35.6|********
37.0|********
38.5|********
40.0|*******
41.5|*******
43.0|******
44.4|******
45.9|******
47.4|******
48.9|*******
50.4|*******
51.9|********
53.3|********
54.8|********
56.3|**********
57.8|***********
59.3|*************
60.7|****************
62.2|*******************
63.7|**********************
65.2|************************
66.7|*************************