Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USE PYTHON AND VERIFY OUTPUTS IF YOU WILL SPAM IT I WILL REPORT Problem 3 - Red Sox Predictions This is definitely going to be

USE PYTHON AND VERIFY OUTPUTS

IF YOU WILL SPAM IT I WILL REPORT

image text in transcribedimage text in transcribed

Problem 3 - Red Sox Predictions This is definitely going to be our year! Rafi Devers (he/him), a player for the Boston Red Sox (and Laney's fave!), has been working hard in the offseason and we expect him to improve his batting average. In 2021, Rafi had 89 singles, 37 doubles, 1 triple, 38 home runs, and 591 at-bats. Each single, double, triple, and home run counts as a hit. He expects to have the same number of total at-bats this year as he did last year. Using this information, compute and report the following stats from Rafi's 2021 season: Batting average (BA): Ratio of total hits to at-bats. Total bases (TB): Weighted sum of bases reached, 1 = single, 2 = double, 3 = triple, 4 = homer. Slugging percentage (SLG): Ratio of TB to at-bats. = Your program should also prompt the user to enter a target batting average for Rafi's 2022 season. Calculate and report how many hits he will need in 2022 in order to reach that target batting average, assuming he has the same number of total at-bats as he did in 2021. For full credit under the documentation category, write two test cases in a comment at the top of your file, like this but your own info. Do this before you start coding -- that way you know your program works! Test case #1: .300 target batting average 2022: 177 hits to get that BA Test case #2: .755 target batting average 2022: 446 hits to get that BA Here's an example of what happens when we run our program (your formatting doesn't need to look exactly like ours, but make sure you round those floats when printing): Ready to predict Rafi Devers's next season? Heck yeah we are! What will his BA be in 2022? 1.755 2021 results! Hits: 165 TB: 318 BA: 0.279 SLG: 0.538 In 2022, Rafi Devers needs... Hits: 446 To get BA: 0.755

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

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

define EFFECTIVE PARTICIPATION

Answered: 1 week ago