This world is inhabited by small, friendly creatures known as Poke-, sorry, Codémon (please don't sue us). A popular activity for the people (or “coaches”, as they will be referred to from here on out) of this universe is to wander around collecting as many of these Codémon as they can in pocket sized Codéballs, which function as small pocket dimensions. Due to reasons that definitely do not involve making them fight each other, sometimes these poor creatures become injured. When this happens, they will need to be taken to a Codécenter, which can be thought of as a hospital for Codémon. Up until now, these Codécenters charged no price for their healing services.
Codécenters have had it too good for too long. Codécenters are basically the “hospitals” of the Codémon universe, where coaches can give them Codéballs, and they used to heal the Codémon inside at no charge. Corporate greed has taken over the medical industry of the Codémon world, and they’ve decided to start charging exorbitant prices for their healthcare services. You have been hired to develop the software to calculate the prices that coaches must pay in order to heal their little buddies.
Each region has a different tax value. This tax value must be multiplied by the final price for the final calculation. The region will be the same for ALL customers, so you only need to get this information once for every time your program is run. The regions and tax rates are as follows:
Once a region has been set, you must then be prepared to take in any number of coaches. Each coach may or may not have insurance so you must ask if the coach has insurance. Their insurance rate should then be taken as input from the user as a value (that might have decimals!) between and including 0 and 100. Their final cost will eventually be divided by the insurance rate. Insurance in real life is a little bit more complicated, but let’s keep it simple, huh?
Note: Insurance should be taken from
Each coach can carry anywhere between 1 to 6 Codéballs with them that they need to get healed. This information must be taken as input from the user.
Once you get this information, you will also need to find out what kind of Codéballs the coach is giving the Codécenter, as different balls have different rates.
The rates are as follows:
Certain regions have certain laws pertaining to what kind of Codéballs are allowed by coaches. Specifically, the budget ball is illegal to use if the coach lives in a region that ends with the letter ‘a’ or ‘o’, and also has a boujee ball in their possession. If you find someone to be breaking the law, inform them of the fact that they are going to be arrested immediately. You do not need to finish calculating their cost. Simply arrest the law-breaking coach, and move on to the next coach, if there are any.
Due to a very odd law passed in this universe recently, all calculations must be done using the dollar ($) currency, however, all output must be displayed using the ampersand (&) currency. To convert dollars to ampersands, you must multiply by 11/17 and then add 3.62. Round the final cost up to the nearest penny.
Once the final price has been calculated, give the user the final price charged to the coach, and prompt the user to see if there are any more coaches in the Codécenter. If there are any, repeat this process. If there are no more, give us an exit message and terminate the program.
Since you want to output the total as a monetary amount, your program will need to display 2 decimal places at all times. Because a total of $3.5 or &3.5 looks weird. To do this we can put the follow code into your program
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
After this code, all floating point output will have exactly 2 figures after the decimal point.
Welcome to Wong's Fabulous Codecenter Price Gouger Calculator What region are you using this program from? 1. Konta 2. Jahta 3. Hainn 4. Sennah 5. Ynavo 6. Kolas 7. Olalo 8. Golor Region: 7 Does the coach have insurance (y/n)? y What is this coach's insurance rate (0-100)? 50.123 How many codeballs does this coach need healed (1-6)? 3 Which ball? 1. Code Ball 2. Good Ball 3. Extreme Ball 4. Budget Ball 5. Boujee Ball Ball Type: 3 Which ball? 1. Code Ball 2. Good Ball 3. Extreme Ball 4. Budget Ball 5. Boujee Ball Ball Type: 2 Which ball? 1. Code Ball 2. Good Ball 3. Extreme Ball 4. Budget Ball 5. Boujee Ball Ball Type: 1 Total Cost: &6.87 Are there any coaches left (y/n)? y Does the coach have insurance (y/n)? y What is this coach's insurance rate (0-100)? 101 What is this coach's insurance rate (0-100)? 5 How many codeballs does this coach need healed (1-6)? 7 How many codeballs does this coach need healed (1-6)? 5 Which ball? 1. Code Ball 2. Good Ball 3. Extreme Ball 4. Budget Ball 5. Boujee Ball Ball Type: 4 Which ball? 1. Code Ball 2. Good Ball 3. Extreme Ball 4. Budget Ball 5. Boujee Ball Ball Type: 5 Authorities have been notified and the client will be arrested shortly Are there any coaches left (y/n)? n Good Bye!
Submit your assignment to you Githlab repo with your .cpp file. Your program should be able to be complied and executed on the university machines. If your program automatically fails, there will be a chance we won't even grade it.