Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

When creating the folder and file names for your programs, please use the this naming convention: first_last _baseball_ch XX .py where first_last specifies your first

When creating the folder and file names for your programs, please use the this naming convention: first_last_baseball_chXX.py where first_last specifies your first and last name and chXX specifies the chapter number, as in ch05. For programs that have multiple files, store the files in a folder named first_last_baseball_chXX.

When creating names for variables and functions be creative. Your variables show allow people to know what it's purpose is.

Top-down development

Always start by developing a working version of the program. That way, youll have something to show for your efforts if you run out of time. Then, you can build out that version of the program until it satisfies all of the specifications.

From chapter 5 on, you should use top-down coding and testing as you develop your programs. You might also want to sketch out a hierarchy chart for each program as a guide to your top-down coding.

Chapter 2: Calculate a players batting average

Create a program that displays a welcome message and calculates a players batting average.

Console

================================================================

Baseball Team Manager

This program calculates the batting average for a player based on the player's official number of at bats and hits.

================================================================

Player's name:

Official number of at bats:

Number of hits:

Pat's batting average is 0.000

Specifications

  • The formula for calculating batting average is: average = hits / at_bats The program should accept integer entries.
  • Assume the user will enter valid data.
  • The program should round the batting averages to a maximum of three decimal places.

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

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

Students also viewed these Databases questions

Question

What types of questions should be asked on an application form?

Answered: 1 week ago

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago