Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Tiered baseball player salaries. Create a program that will calculate the salary a player will earn based on the following business rules. Be sure to

Tiered baseball player salaries. Create a program that will calculate the salary a player will earn based on the following business rules. Be sure to refer to the general programming guidelines listed above. Name your project: TieredPlayerSalaryViaIF - Your Name

Tier 1: For 1 through 49 hits in a season, the player earns $17,500 per hit for ALL hits. Tier 2: For 50 through 99 hits, the player earns $20,000 per hit for ALL hits. Tier 3: For 100 through 149 hits, the player earns $22,500 per hit for ALL hits. Tier 4: For 150 or more hits, the player earns $25,000 per hit for ALL hits.

Then consider All Star and MVP (most valuable player) awards: - If a player is neither an All Star NOR a MVP designation, then add 0% to the tiered salary you calculated above - If a player is both an All Star AND and a MVP, then add 25% to the tiered salary you calculated above - If a player is only one of All Star OR a MVP, then add 20% to the tiered salary you calculated above

Note that this is a 'simple' calculation - in that once a player reaches the threshold for the next $ level per hit, the player earns that rate for ALL hits they had. For example, if Player1 had 149 hits in a season, he will earn 149 * 22,500 = $3,352,500. However, if that Player1 would have produced one more hit (150), he would have earned 150 * 25,000 = $3,750,000. Then, consider the impact of the All Star and MVP attributes on the salary calculation mentioned above.

INPUT: Have the user enter the players name, number of hits, one checkbox to indicate if they are an All Star and a second checkbox to indicate if they are a MVP. Then use a Calculate button to process the data. Process the data only if theuserentersaplayersname(anynon-spacecharacterstypedinconstitutesenteringaname). Processthedataonlyifthe user entered a valid hit count. A valid hit count is an integer that is greater than zero, but is less than or equal to 300. Validate the hit count programmatically do not use a masked textbox. Use a validation method we covered other than try..catch to perform the validation. Add a Clear button to clear the data entry fields, checkboxes and calculations.

PROCESSING/OUTPUT: Calculate the players earnings based on the Tier they achieved, and display the calculated salary and Tier number. Use an if () ... decision structure to determine the Tier number and $ per hit amount (do not use a switch (..case...) decision structure). Determine any additional salary amount based on All Star/MVP checkbox settings.

In addition to allowing the entry of the current player name, hits details and calculating the current players salary based on the above, also display a separate summary set of information on the window showing the leading players name , number of hits, salary and Tier number for the player who has had the most hits of all players processed so far, since the Window was opened or since the Clear button was last clicked. You only need to keep track of the ONE leading player, not all players entered in. If there are one or more ties, the first player entered who had the most hits will be the leader.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago

Question

3. Are our bosses always right? If not, what should we do?

Answered: 1 week ago