Homework 2

Due Date: September 17th, 2021 at 12:00pm


Background

The Codémon Academy is the premiere for-profit monster fighting academy (Pokemon Academy is the non-profit one). The Academy has hired you for a lucrative amount (that you yourself will never see) to create a program for their new admissions system.

The purpose of this program is to decide whether the student should be admitted to the Academy and to determine how much the applicant will be paying if they were to attend.

To increase their chances, applicants can hire an "academy admissions expert" that can direct the applicant to "donate" money to school athletic directors. If the applicant does such, we record how much money was paid to the academy's athletic director, which will increase the applicant's chances in getting into the academy.

The administration of the academy also seem to have an infatuation with the 90's hit TV show "Brimful Residence" (which they watch during work hours). We have no idea why, but they seem to specifically fixate on the character "Aunt Becky". Therefore, all applicants who have parents who were cast in "Brimful Residence" will have a high chance of getting into the academy.

Specifications

You will write three functions:
  1. isAdmitted()
    • Returns whether or not the applicant was admitted into the academy.
  2. calculateDonationProbability()
    • Returns the chance the applicant will donate to the academy in the future.
  3. calculateTuition()
    • Returns the amount of tuition the applicant will pay if accepted

Note: Use your best judgement on deciding the parameters of each function. Do not pass in parameters that are not used. You will continue to ask for inputs and students until there are no more applicants for the user to process.

Input

Your program will prompt the user for a specific set of inputs:
  1. How many tournaments the applicant has won
  2. How many Codémon the applicant owns
  3. The household income of the applicant
  4. Whether the applicant has parents that were in the 90’s hit tv show “Brimful Residence”
  5. How much money the applicant has paid off/donated to the academy’s athletic director.

After all questions are prompted, the program will output whether the applicant is accepted and if so how much they would have to pay to attend the academy. You do not need to calculate the price to attend the academy if the applicant is not accepted. No need to waste computing power on heathens.

The specifics of each input is as follows:

  1. There are only 50 tournaments in the world. Therefore, an applicant cannot have more than 50 tournament wins.
  2. A coach cannot legally own more than 30 Codémon. However, the academy does not want trouble so give the applicant the benefit of the doubt and assume the applicant just entered the number wrong.
  3. Codémon Academy does not allow applicants with a household income of less than $30,000 to apply. If they enter less than $30,000, move onto the next student.
  4. You hopefully should not need information on this data type.
  5. Codémon Academy takes pride in their prestige. As a result, all bribes/donations below $100 will not be accepted.

Function Specifications

isAdmitted()

isAdmitted() will return whether the applicant got into the academy or not. To determine this, each applicant is given a score and applicants that score above 30 points will be admitted to the academy. There are two ways for applicants to earn points, applicants will receive 10 points per tournament that they have won and 2 points per Codémon they own. The applicant's final score will be calculated by the following formula: total_points + (total_points * donation_percentage). Where donation_percentage comes from the calculateDonationProbability(). In this universe, the number of codemon you own is sometimes considered personal information. Therefore, the academy does not require the applicant to enter the number of codemon they have. This is denoted by a "-1" when the data is entered into the program. In this case, overload the isAdmitted() function to calculate the score of the applicant just from how many tournaments they have won and their donation percentage.

calculateDonationProbability()

Each applicant starts out with a 1% chance of donating to the school. If the applicant has parents from the hit 90's show "Brimful Residence", add 10% to the chance that the applicant will donate.If the application's household income is above $200,000 add 10% and if above $500,000 add 20% instead. The donation percentage will also increase based on how much money the applicant has already donated (to the athletic director). The donation chances will jump up by 5% if the applicant has already donated more than or equal to $10,000 and 10% if they have donated more than or equal to $100,000. After numerous heated free caviar meetings with the academy administration, the academy has deemed any cast member from the tv show "Brimful Residence" who's household makes less than $200,000 is not cool enough for this academy to consider them special. In fact, the school denies their existence in "Brimful Residence". You will need to update the variable that indicates if the applicant's parents were cast of Brimful Residence to reflect the administration's decision.

Clarification: Logically, the applicant's parent's status as "true" cast members of the hit 90's tv show "Brimful Residence" should be included in tuition. Since you should not calculate tuition if the applicant does not make it into the academy, you have to make a decision before calculating tuition. Therefore, the change would have already been made if you are already calculating tuition.

Another Clarification: There is no specific instruction that says to revoke the 10% if the applicant is not deemed a "true" cast member of Brimful Resident. So don't. If they are not "true" cast member, they get to keep the donation percentage.

calculateTuition()

Tuition will start from randomly generated floats between $50,000.00 and $1,000,000.00 inclusive, ( [50000,1000000]). I know the range is absurd but this is a for-profit university. We want the starting tuition to have exactly a precision of 2 (2 decimal places). Not just at output, but the variable itself.

There are many ways for the candidate to get scholarships to reduce their total tuition cost. First, the score from isAdmitted() is multiplied by 100 and will be subtracted from the tuition cost. The applicant will also receive a $5,000 scholarship for each tournament they have won (i.e Josh won 16 tournaments, so he gets a $80,000 scholarship). If the applicant's parents are from the hit 90's tv show "Brimful Residence", the applicant will receive an extra $20,000 in scholarship money.

The tuition can also increase in this function as well. The applicant's tuition will increase an extra $20,000 for every $100,000 of their income (i.e if Ash's family's income is $432,000, he will have an extra $80,000 added to his tuition). The scholarship money has the possibility of reducing tuition in its entirety and even making tuition a negative number. However, the Academy is not a "nice" institution. Therefore, if the amount of tuition money subtracted causes the cost of attending the academy to be negative, the tuition will cost $3.50.

Notes

Sample

Note: you do not have to include the starting tuition, student scholarship, and tuition increase in your output. If you wish to include such output you can, it may help you debug if there are errors. I put the output there for your (and possibly my) convenience.

Welcome to the Codemon Academy admission program
How many tournaments has the applicant won? 5

How many codemon does the applicant own? 3

What is the household income of the applicant? 100000

Where the applicant's parents in the hit 90's TV Show "Brimful Residence"? n

How much money has this applicant paid off to the athletic director? 500

The student has been accepted with a score of: 56.56
Starting Tuition: 975478.94
Student Scholarship Total: 30656.00
Tuition Increase: 20000.00
The student will pay: 964822.94