Question: [10 points] Create an m-file that determines the bonus a basketball player eans given the number of games he/she plays and the average points per

 [10 points] Create an m-file that determines the bonus a basketball

[10 points] Create an m-file that determines the bonus a basketball player eans given the number of games he/she plays and the average points per game scored given the following requirements. a. Request the player's name, number of games played in the season and the average points per game scored over the season. Use p name, n games, and ppg as the variables, respectively b. Players who played in 5 games or less earn a bonus of $2000, regardless of points per game c. Players who played in more than 5 games but less than or equal to 10 games earns a bonus of $2000 plus $100 times his/her average points per game d. Players who played in more than 10 games, but less than or equal to 20 games earn a bonus of $2000 plus $400 times his/her average points per game e. Players who played in more than 20 games earn a bonus of $3000 plus $500 . times his/her average points per game f. Use the variable bonus to assign the money earned by the player The m-file should output a statement using fprintf that reads as follows: "p_name earned $'bonus" based on "n games played and the average points per game of $ppg". Make sure that dollar signs are included on the bonus. Your fprintf statement should terminate with a naw line

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!