CS 54 - Lab 7


Lab Assignment

RARO is Automobile Rip Offs (RARO) was so pleased with your previous work that they want you to do additional work on their database system. This time, they want you to rework the customer entry and tracking part of their database systems. The old system was governed by this struct:
struct customer
{
  unsigned int customerID;
  string name;
  double amountSpent;
  unsigned short numTimesRippedOff;
};


Lab Assignment - Part I (Required - 8 Points)

RARO wants you to write two functions to deal with the customers in their database:

In your main() function, be sure to create a customer using makeCustomer() and have the customer go to the store once using conductBusiness().


Lab Assignment - Part II (Quasi Required - 10 Points)

Extend your part I to do the same operations on an array of 6 customers.


Lab Assignment - Part III (Extra Credit - 12 Points)

RARO wants you to test the database using some random data to make sure everything works. In this test, you are to choose a random number x where 6 ≤ x ≤ 42 and run the same code from Part II x times. Since x is greater than the number of items in the array, you should just loop back when the end of the array is reached. That is, you should run the test on customers 0, 1, 2, 3 4, 5, 0, 1, 2, 3, 4, 5, … until the test has run x times. After running the test, RARO wants you to report the arithmetic mean of the amount spent and number of times ripped off.


Grading & Submission

Part I is worth 8 points. Part II is worth 10 points (Part I + 2 more points). Part III is worth 12 points (Part II + 2 points extra credit). The lab is out of 10 points. When you're done, submit your lab06.tar.gz file on Blackboard. I will be grading your program on the following criteria:


[Dilbert]