The RARO Management Team has been so impressed by your previous work, they sacked you for knowing too much. No sweat. As a talented computer scientist, your job search was short. The US Department of the Treasury hired you to programmatically represent and test their new coin architecture. A design consultant already sketched out this class to represent the coins:
class Coin
{
public:
Coin();
Coin(const string &newFace, double newValue);
string getFace() const;
double getValue() const;
void print() const;
void setFace(const string &newFace);
void setValue(double newValue);
private:
string face;
double value;
};
Implement & test the definition the consultant left for you. Make sure all member functions work before attempting Part II. NOTE: Be sure the default constructor builds a coin with an empty face and a value of 0.00.
Create an array of 4 Coins, add up the values, and output how much money you have to the screen.
The Treasury Department wants you to simulate how the Wilkerson Coin will affect commercial transactions. Create an array of 50 coins and randomly make the coins one of the coins from the following table:
| Coin Value | Coin Face | Comment |
| 0.00 | NULL Coin | |
| 0.02 | Josh Wilkerson | Wilkerson Coin |
| 0.05 | Thomas Jefferson | Nickel |
| 0.10 | Franklin Delano Roosevelt | Dime |
| 0.25 | George Washington | Quarter |
For the sake of this test, the Treasury Department said not to worry about the, half dollar, dollar, etc. Now randomly generate 100 prices on the interval [0.00, 10.21]. For each price, determine whether exact change can be used using the 50 coins. Report the amount of times exact change was used and the number of times exact change was not used.
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 lab10.tar.gz file on Blackboard. I will be grading your program on the following criteria:
![[Dilbert]](dilbert.gif)