Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 2 - Tennis Results: Learning outcome focus: Decision Structures File name: a1_2_tennis.py This program helps determine the results of junior tennis matches. Players play

image text in transcribed
Program 2 - Tennis Results: Learning outcome focus: Decision Structures File name: a1_2_tennis.py This program helps determine the results of junior tennis matches. Players play for a fixed time, not to a goal score, then one player enters the scores. The system then determines their match result. The player is asked for two scores - the number of games they won, then the number of games their opponent won. (Note that in tennis, score = number of games, so in the first example below, 5 total games were played; 3 won by player 1, 2 won by the opponent.) Based on their score, they either win, lose or draw. If a match has at least 8 total games (combined score), then they are congratulated for playing a fast match. With (next to) your pseudocode for this question, include a brief justification/explanation of which decision pattern(s) you chose to use and why. Note: there is no looping or error-checking in this program. Sample Output from 3 different runs: Welcome Player 1. How was your match? Your score: 3 Opponent score: 2 You won! :) Welcome Player 1. How was your match? Your score: 4 Opponent score: 72 You lost : ( Keep trying. Congratulations on playing a fast match! Welcome Player 1. How was your match? Your score: 4 Opponent score: 4 It's a draw. Congratulations on playing a fast match

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions