Question

In: Computer Science

Programming Project #6: Bowling Team need to use python Problem Expected Duration: 3-4 hours Prerequisites: None...

Programming Project #6: Bowling Team

need to use python

Problem

Expected Duration: 3-4 hours

Prerequisites: None

Knowing that you are a budding programmer, your friends have asked you to create a scoring program for your Saturday bowling league. Your program should take a name, team number, and score for each player, and should deal with any number of players, but have 3 people to a team.
Your program should ignore invalid inputs, and not crash. Your program should print the following lists in columns:

  1. the individual names, team and scores in descending order with high scorer at the top
  2. the individual names, team and scores in alphabetical order
  3. If anyone scores a perfect game, put an asterisk in front of their name.
  4. The top 3 teams with the highest total scores and their score
  5. Display a congratulatory message showing the individual high score and list who got it.
  6. Display a sympathetic message showing the individual low score and who got it.

Last, your program should write each of the lists and the summary information
to a text file called game_results.txt in the same format it is displayed on the screen.

Note: You have the option of using pandas Dataframes in your program. Just make sure the console and file output
has the required structure and format.

Solutions

Expert Solution

#function to check alphabetical order

def isGreater(name1,name2):

length=0

if(len(name1)<len(name2)):

length=len(name1)

else:

length=len(name2)

for i in range(0,length):

if(ord(name1[i])>ord(name2[i])):

return True

elif (ord(name1[i])<ord(name2[i])):

return False

return False

def scoresData():

data=[]

while True:

player=input("Enter the Name and Score of a Player :: ")

if(player==''):

break

data.append(player.split());

print("----------------------------------")

print("\tEntered Order::\nPlayer Name \t Score")

print("----------------------------------")

for player in data:

print(player[0],"\t\t",player[1])

print()

for i in range(0,len(data)+1):

for j in range(0,len(data)-i-1):

if(isGreater(data[j][0],data[j+1][0])):

temp=data[j]

data[j]=data[j+1]

data[j+1]=temp

print("----------------------------------")

print("\tAplhabetical Order::\nPlayer Name \t Score")

print("----------------------------------")

for y in data:

print(y[0],"\t\t",y[1])

print()

for i in range(0,len(data)):

for j in range(0,len(data)-1):

if(int(data[j][1])<int(data[j+1][1])):

temp=data[j]

data[j]=data[j+1]

data[j+1]=temp

print("----------------------------------")

print("\tScore Order::\nPlayer Name \t Score")

print("----------------------------------")

tot=0

for x in data:

print(x[0],"\t\t",x[1])

tot=tot+int(x[1])

print()

print("Congratulations! Mr/Ms."+data[0][0]," You scored highest of ",data[0][1],".")

print("Oh! Mr/Ms."+data[-1][0]," Sorry to say that scored minimum of ",data[-1][1],".")

print("Average of scores \t:: ",int(tot/len(data)))

scoresData()

OUTPUT:::


Related Solutions

*Python Stock Exchange Data Problem Expected Duration: 3-6 hours A comma-separated value file stocks_data.csv contains historical...
*Python Stock Exchange Data Problem Expected Duration: 3-6 hours A comma-separated value file stocks_data.csv contains historical data on the Adjusted Closing Price for 3 stocks daily from Jan 2, 2009 to Dec 31,2018. The stocks are Apple (APPL), Microsoft (MSFT) and IBM (IBM). A snippet from the data file looks like the following: Symbol Date Adj. Close MSFT 4/16/2014 35.807358 MSFT 6/21/2010 20.752356 IBM 2/10/2009 68.930023 AAPL 2/14/2018 164.227203 IBM 6/13/2017 141.24379 IBM 12/26/2017 142.835663 MSFT 4/1/2009 15.053272 AAPL 4/17/2009...
3. The client of a project has requested the project team to crash 8 hours of...
3. The client of a project has requested the project team to crash 8 hours of time. The table below provides the necessary information about the possible project crashing. (a) What is the crash cost for 8 hours of time-savings? (b) Assume the team calls the client and asks for a project extension, reducing the amount of time they need to crash. The project team has a $20 crash budget. Is the budget sufficient to crash 4 hours of time?...
Use the Python programming language to complete below (I need the New Answer for this, and...
Use the Python programming language to complete below (I need the New Answer for this, and please provide the screenshot of the source code. Thank you!): A website requests an user to input his account password. Write a program to examize the validity of the password. The valid password must consists of: At least 1 letter in [a-z] At least 1 number in [0-9] At least a letter in [A-Z] (capital) At least one special letter in [$#@] At least...
Use the Python programming language to complete below (I need the New Answer for this, and...
Use the Python programming language to complete below (I need the New Answer for this, and please provide the screenshot of the source code. Thank you!): Write a function to seek for all even numbers and odd numbers in the middle of two number A and B. Print even and odd numbers in 1 and 2020 (including both these two numbers)
Programming language is in python 3 For this project, you will import the json module. Write...
Programming language is in python 3 For this project, you will import the json module. Write a class named NobelData that reads a JSON file containing data on Nobel Prizes and allows the user to search that data. It just needs to read a local JSON file - it doesn't need to access the internet. Specifically, your class should have an init method that reads the file, and it should have a method named search_nobel that takes as parameters a...
Programming language is python 3 For this project, you will import the json module. Write a...
Programming language is python 3 For this project, you will import the json module. Write a class named NeighborhoodPets that has methods for adding a pet, deleting a pet, searching for the owner of a pet, saving data to a JSON file, loading data from a JSON file, and getting a set of all pet species. It will only be loading JSON files that it has previously created, so the internal organization of the data is up to you. The...
MUST BE PYTHON 3 Instructions: The following programming problem can be solved by a program that...
MUST BE PYTHON 3 Instructions: The following programming problem can be solved by a program that performs three basic tasks (Input Data, Process Data, Output Results) along with selection and repetition coding techniques. Problem Statement A finance company provides loans for motorcycles at different rates depending on how much the total loan amount is and how many payments will be made on the loan. Using the information in the table below, write a program that will calculate the monthly payment...
Programming language in Python Suppose, for Jane, n1 = 3, n2 = 4, and n3 =...
Programming language in Python Suppose, for Jane, n1 = 3, n2 = 4, and n3 = 5. Also suppose, Jane iterates the number from 1 to 15. At the beginning, Jane sets count to 0, and then proceeds iterating the number from 1 to 15 and for each iteration does the following: for 1, count is increased by 1 because it is not divisible by 3, 4, and 5; count is now: 1 for 2, count is increased by 2...
Using Python Programming PROBLEM 3 - OLD MACDONALD: Write a program to print the lyrics of...
Using Python Programming PROBLEM 3 - OLD MACDONALD: Write a program to print the lyrics of the song ”Old MacDonald”. Your program should print the lyrics using five different animals (i.e., cow, sheep, dog, cat ,turkey) using the example verse below. For this problem you are required to write then make use of a function getVerse that takes two string parameters: (1) the name of an animal and (2) the sound that animal makes. The function should not print anything...
Problem 1 ✓ Problem 2 Problem 3 ✓ Problem 4 … Problem 5 … Problem 6...
Problem 1 ✓ Problem 2 Problem 3 ✓ Problem 4 … Problem 5 … Problem 6 ✓ Problem 7 Problem 8 Problem 9 close sidebar webwork / f2019stat213 / stat_213_assignment_3 / 5 STAT 213 Assignment 3: Problem 5 Previous Problem Problem List Next Problem (1 point) To examine the effectiveness of its four annual advertising promotions, a mail order company has sent a questionnaire to each of its customers, asking how many of the previous year's promotions prompted orders that...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT