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 python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  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 python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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