ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 27 Apr 2017 My Price 9.00

scores of two volleyball teams that play each other

This program needs to be written in Python!!!

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.

Answers

(11)
Status NEW Posted 27 Apr 2017 06:04 AM My Price 9.00

-----------

Attachments

file 1493276622-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)