Compare the scores of two volleyball teams

Assignment Help Python Programming
Reference no: EM131530098

Final Project

Your program is going to compare the scores of two volleyball teams that play each other. To win a match in volleyball, a team must get 25 points. But the team must also win by 2. So even if a team reaches 25, that game continues until one team is ahead by 2 points. Let's assume that these two teams are going to play five matches.

Your program should accept from the user the scores for each team one match at a time. If at any time that user enters scores that violate the 25-point rule or the "win by 2" point rule, print an error on the screen and make the user enter both scores again.

When the user is finished entering the scores, the program should print which team won the game. This is the team that won the most matches.

You have to use arrays and loops in this assignment.

In the sample output examples, what the user entered is shown in italics.

Sample Output 1

Welcome to the volleyball score program.

Enter the number of points Team 1 got in Match 1
10
Enter the number of points Team 2 got in Match 1
25
Enter the number of points Team 1 got in Match 2
1
Enter the number of points Team 2 got in Match 2
25
Enter the number of points Team 1 got in Match 3
23
Enter the number of points Team 2 got in Match 3
25
Enter the number of points Team 1 got in Match 4
10
Enter the number of points Team 2 got in Match 4
25
Enter the number of points Team 1 got in Match 5
0
Enter the number of points Team 2 got in Match 5
25
Team 2 has won the game.

Sample Output 2
Welcome to the volleyball score program.
Enter the number of points Team 1 got in Match 1
10
Enter the number of points Team 2 got in Match 1
24
That can't be. One team must get at least 25 points. Please reenter the data.
Enter the number of points Team 1 got in Match 1
10
Enter the number of points Team 2 got in Match 1
25
Enter the number of points Team 1 got in Match 2
1
Enter the number of points Team 2 got in Match 2
25
Enter the number of points Team 1 got in Match 3
23
Enter the number of points Team 2 got in Match 3
25
Enter the number of points Team 1 got in Match 4
10
Enter the number of points Team 2 got in Match 4
25
Enter the number of points Team 1 got in Match 5
24
Enter the number of points Team 2 got in Match 5
25
That can't be. One team must win by 2 points. Please reenter the data.
Enter the number of points Team 1 got in Match 5
24
Enter the number of points Team 2 got in Match 5
26
Team 2 has won the game.

Verified Expert

In this I have created the simple volleyball score program.I have implemented this program in python language using loops and conditional statements.

Reference no: EM131530098

Questions Cloud

Explain the omitted-variable regression : Define the term "multicollinearity." Explain how you would detect its presence in a multiple regression equation you have estimated.
How human psychology impacts hci : Using your own life experiences, analyze how your screens and computer-supported media and information have changed over time.
Conduct some independent online research : Conduct some independent online research on OD career opportunities in your area. Try search terms like: organizational development, organizational effectiveness.
What variables do you expect to be highly correlated : In a study analyzing the determinants of faculty salaries, the results shown on p. 296 were obtained." The dependent variable is 1969-1970 academic year salary.
Compare the scores of two volleyball teams : Compare the scores of two volleyball teams that play each other. To win a match in volleyball, a team must get 25 points.
Discuss the details of their work with their families : How much should a first responder discuss the details of their work with their families?
Significant stressors for first responder families : Choose one of the following topics:Significant Stressors for First Responder Families,Major Concerns for First Responders Regarding Family Stress.
Explain the multicollinearity problem : Estimate demand for food functions on the basis of the data in Table. Discuss if there is a multicollinearity problem and what you are going to do about it.
What is the bond equivalent yield of this bond : What is the bond equivalent yield of this bond if you pay the price computed in %?

Reviews

inf1530098

7/29/2017 6:16:45 AM

There is nothing like arrays in the python. We have LIST data structure alternate for Arrays. Do i need to use list for this assignment.? Although it is not necessary. It will be helpful for me if you can tell me what things you need to convert into array(list) from the code. have used the arrays to store the team scores like your professor said and also like the screenshot you have shared. I have followed the sample assignment you provided us. Please check the solution sent in previous mail, if still you have any query, please let us know. have made the changes. Now each team score is stored in array. You can see that in output image. My output is exactly same as the sample outputs as in the assignment instructions

Write a Review

Python Programming Questions & Answers

  Write a program in python to draw a simplified face

Write a program in Python to draw a blue triangle in a drawing window. Write a program in Python that moves the triangle in an animated movement. Write a program in Python to draw a simplified face.

  Write a class named employee

Write a class named Employee that holds the following data about an employee in attributes: name, ID number, department, and job title

  Improve the code for the haunted house game

Improve the readability of the code by improving the function names, variables, and loops, as well as whitespace. Document these changes in your journal and define a win condition for the game, for example, collecting all items and returning to the..

  Aussie best car abcdeclares that based on its yearly sales

aussie best car abcdeclares that based on its yearly sales it will award a bonus as follows. the bonus will be equally

  Project- add time and object interaction to the simulation

Project: Add Time and Object Interaction to the Simulation. Bring the simulation to life with simulated time and object interaction. Illustrates the alternative flow of control for errors provided by try/catch in place of returned error codes

  Write a program that does simple packet routing

Write a program that does simple packet routing and your program will take three command-line arguments:

  Write a program to render an animated humanoid walking robot

Write a program to render an animated humanoid walking robot. r robot must have two arms and two legs that are made of cylinders. each arm is made of the upper arm and lower arm (forearm).

  Recursive sorts are easier to write in functional style

Recursive sorts are easier to write in functional style than others. Two recursive sorts are  Quicksort and Mergesort. Write functional versions of (a) Quicksort; (b) Mergesort in an  imperative language of your choice (e.g., C, Ada, C++, Python), us..

  Write a python script that will implement the given command

Write a python script that will implement the following command: The idea is that the contents of sourcedirectory1 and sourcedirectory2 are going to be copied and merged together into a new destination directory.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write a function comp(d1,u1,d2,u2)

Write a function comp(d1,u1,d2,u2)

  Write a program to receive a series of numbers

Write a program to receive a series of numbers (including decimal) from the user until enter key is pressed. Process the input data and display number count, sum and average. Use proper data type and format.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd