Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[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

image text in transcribed
[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

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 Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions