Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Part A) : Sports Analytics 60 points The data analyst for ESPN needs to calculate the statistics for the NBA Los Angeles Clippers. Write a

(Part A) : Sports Analytics 60 points

The data analyst for ESPN needs to calculate the statistics for the NBA Los Angeles Clippers. Write a program to calculate the two and three point field goal percentages made by the Team based on the number of total shots attempted and total shots made. You can enter any statistics to test program.

In addition to main() (worth 25 pts), also use the following seven functions in your program

(worth 5pts each) :

getTotalNumberOfTwoPointsAttempted() : a value-returning function that asks for the total number of two points attempted. Use a return statement to send it to main().

getNumberOfTwoPointsMade() : a value-returning function that asks for the number of two points made, relative to the number of two points attempted. Use a return statement to send it to main().

getTotalNumberOfThreePointsAttempted() : a value-returning function that asks for the total number of three points attempted. Use a return statement to send it to main().

getNumberOfThreePointsMade() : a value-returning function that asks for the number of three points made, relative to the number of three points attempted. Use a return statement to send it to main().

getPercentageOfTwoPointsMade() : a value-returning function that calculates the the percentage of two points made. Use a return statement to send it to main().

getPercentageOfThreePointsMade() : a value-returning function that calculates the the percentage of three points made. Use a return statement to send it to main().

IsBetterThanChance() : a value-returning function that returns true or false (true: if the team made 50% or above percentages of total shots and false: if the team made less than 50% percentages of shots) Display message in main() based on this return value.

NOTE:

  1. The problem requires that you determine the parameters needed for each function.
  2. The main() function should display the statistics on the computer screen.
  3. No Global non-constant variables should be used.

(Part B) : Pass by value versus pass by reference 40 points

Write a C++ program which prompts user to choose from the two alternative funtions specified below, each of which returns a random message. The random number generator function should be called from within the functions.

The two functions are:

  1. Function messageByValue is a value returning function that returns the message by value and
  2. Function messageByReference is a void function that returns the message by reference.

Each function returns one of four random messages:

  1. Sorry. Youre not close enough! returned 25% of the time
  2. Oh, youre almost there? returned 15% of the time
  3. Aw cmon, you can do better than that! returned 20% of the time
  4. Youre up big. Getting closer to breaking your old record returned 40% of the time

NOTE: Use a while loop to continually run program until a -1 is entered to Terminate program.

  1. The problem requires that you determine the parameters needed for each function.
  2. The message should be displayed in main().
  3. No Global non-constant variables should be used.

C++

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

=+4 Develop and deliver the CCT program.

Answered: 1 week ago

Question

=+5 Evaluate whether the CCT program was effective.

Answered: 1 week ago

Question

=+Identify the type of global assignment for which CCT is needed.

Answered: 1 week ago