ENGN 38

Lab Programming Assignment #8

 

 


Instructions:

Re-write lab#7 using a class/object approach.

  • Define a class called Roughness with private member variables and public member functions.
  • Write a main program that declares an object of the class Roughness and accomplishes the same results as Lab #7.
The member variables of the class Roughness should include
  • a double array to hold the roughness data
  • three doubles to hold the values for arithMeanValue, rmsValue and the maxHeight
  • an int for the count       

The member functions might be constructors, accessor, mutator and/or input and output functions. 

Use naming conventions for function names as follows:

  • Accessor Functions:  getXxxx  where Xxxx is a descriptive name or the name of a member variable.
  • Mutator Functions:  setXxxx  where Xxxx is a descriptive name or the name of a member variable.
  • I/O Functions:   xxXxxx where xxXxxx is a descriptive name.

Make sure to include a default constructor function that zeros all the member variables.

...

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. 

                   

 

 

Roughness Data File

Data values are in micormeters

-4.1                 

-2.2                 

-0.5

1.2

3.3

4.6

5.1

2.1

0.2

-3.6

-4.1

0.2

0.5

2.2

4.1

-0.2

-1.2

-3.3

-4.6

-5.0

-2.2

-1.1

0.8

3.2

-0.1

-4.8

 

 

 

Output Report Requirements

Surface Roughness Data (micrometers)

               

                -4.1        

                -2.2

                 0.5

                  .

                  .

                  .

 

Roughness Parameters

 

                Arithmetic Mean          =    x.x   mm

 

                Root-Mean-Square     =   x.x    mm

 

                Maximum Roughness  =   x.x    mm