subject

This assignment focuses on the design, implementation, and testing of python programs to process data files using lists and tuples, as described below.
assignment specifications:

1. you will develop a python program to manage information about baseball players. the program will maintain the following information for each player in the data set:

player’s name (string)
team identifier (string)
games played (integer)
at bats (integer)
runs scored (integer)
hits (integer)
doubles (integer)
triples (integer)
homeruns (integer)
2. the program will recognize the following commands:

quit

input filename
team identifier
report n players

the program will be operated interactively: it will prompt the user and accept commands from the keyboard.
if the user enters an invalid command, the program will display an appropriate message and prompt the user to enter another command.
3. the "quit" command will halt execution.
4. the "" command will display information to the user about the commands recognized by the program.
5. the "input" command will be followed by a string representing the name of an input file. the program will discard the current data set stored in memory, and then process the input file as the source for a new data set (open the file, read the file once and store the records, then close the file).
an input file contains zero or more player records, where each record consists of the nine fields listed above. the records are separated by newlines, and the fields are separated by semicolons.
if the user enters an invalid file name, the program will display an appropriate message and prompt the user to enter another file name. the program will halt after the user enters an invalid file name three consecutive times.
6. the "team" command will be followed by a string representing a team identifier. the program will display all information about all players on that team.
if the user enters an invalid team identifier, the program will display an appropriate message and prompt the user to enter another command; the program will not display an empty table.
7. the "report" command will be followed by an integer number and a string (one of "hits", "batting" or "slugging").
if the user enters an invalid command, the program will display an appropriate message and prompt the user to enter another command; the program will not display an empty report.
for each report, the program will display all information about the top "n" players in a given category:

hits -- number of hits
batting -- batting average
slugging -- slugging percentage

8. the program will display appropriate messages to inform the user about any unusual circumstances.

de aza, alejandro; cws; 153; 607; 84; 160; 27; 4; 17
hunter, torii; det; 144; 606; 90; 184; 37; 5; 17
hamilton, josh; laa; 151; 576; 73; 144; 32; 5; 21
choo, shin-soo; cin; 154; 569; 107; 162; 34; 2; 21
upton, justin; atl; 149; 558; 94; 147; 27; 2; 27
cabrera, miguel; det; 148; 555; 103; 193; 26; 1; 44
posey, buster; sf; 148; 520; 61; 153; 34; 1; 15
suzuki, ichiro; nyy; 150; 520; 57; 136; 15; 3; 7
holliday, matt; stl; 141; 520; 103; 156; 31; 1; 22
headley, chase; sd; 141; 520; 59; 130; 35; 2; 13

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 21:00, tiffg2588
Will this setup result in what kathy wants to print?
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, bellamyciana
What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the file tab. click the file tab, then click print, or click the page layout tab. click the page layout tab, or click the review tab. click the review tab, or click the home tab?
Answers: 2
image
Computers and Technology, 24.06.2019 13:00, Savtheartist23
Ais a built in formula in spread spread a is any math process such as addition or subtraction. options are function and operation
Answers: 1
image
Computers and Technology, 24.06.2019 17:50, connorwbrown07
Acontact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. write a program that first takes in word pairs that consist of a name and a phone number (both strings). that list is followed by a name, and your program should output that name's phone number.
Answers: 1
You know the right answer?
This assignment focuses on the design, implementation, and testing of python programs to process dat...

Questions in other subjects: