Each player in a tournament plays six games. There are no ties. The tournament director places...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows: • if a player wins 5 or 6 games, they are placed in Group 1; if a player wins 3 or 4 games, they are placed in Group 2; • if a player wins 1 or 2 games, they are placed in Group 3; • if a player does not win any games, they are eliminated from the tournament. Write a program to determine which group a player is placed in. Input Specification The input consists of six lines, each with one of two possible letters: W (to indicate a win) or L (to indicate a loss). Output Specification The output will be either 1, 2, 3 (to indicate which Group the player should be placed in) or -1 (to indicate the player has been eliminated). Sample Input 1 W L W W L W Output for Sample Input 1 2 Copy Copy Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows: • if a player wins 5 or 6 games, they are placed in Group 1; if a player wins 3 or 4 games, they are placed in Group 2; • if a player wins 1 or 2 games, they are placed in Group 3; • if a player does not win any games, they are eliminated from the tournament. Write a program to determine which group a player is placed in. Input Specification The input consists of six lines, each with one of two possible letters: W (to indicate a win) or L (to indicate a loss). Output Specification The output will be either 1, 2, 3 (to indicate which Group the player should be placed in) or -1 (to indicate the player has been eliminated). Sample Input 1 W L W W L W Output for Sample Input 1 2 Copy Copy
Expert Answer:
Answer rating: 100% (QA)
mainpy WHEE HEN L W 2 Initialize a variable to keep track of the number of wins 2 wins 0 Read in... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
What are the 4 specialties of structural engineering? Any resources for core principles of structural engineering?
-
Write a literature review for your study. See below for an example of a literature review. Your literature review should provide both analysis and synthesis of previous studies as related to the...
-
A sociologist is studying what factors may affect whether college students would support new laws that would make it a crime for students to purchase papers from the Internet and then turn in the...
-
Either: Prove that k-means will produce k clusters, allnonempty, OR: Give anexample of a set D of data points (with no repeated data point), avalue for k(k
-
Two slits spaced 0.260 mm apart are placed 0.700 m from a screen and illuminated by coherent light with a wavelength of 660mm. The intensity at the center of the central maximum ( = 0o) is I0. (a)...
-
Sequence the numbers in straight number order. 39-83-01 14-83-06 39-84-01 23-01-54 24-01-54 10-40-99 11-40-98 90-17-54 56-83-06 11-39-98 15-84-06 12-40-98
-
Diet Cola and Weight Gain in Humans A study found that American senior citizens who report drinking diet soda regularly experience a greater increase in weight and waist circumference than those who...
-
For no apparent reason, a poodle is running at a constant speed of v ~ 5.00 m/s in a circle with radius R = 2.50 m. Let VI be the velocity vector at time t" and let V2 be the velocity vector at time...
-
Command Sales Cost of goods sold Wu Company Income Statement For the Year Ended December 31, 2022 Gross margin Operating expenses (including depreciation expense of $46,800) Income from operations...
-
Get It Right, CPAs, has been retained to review its client's corporate formation calculations for 20XX. Maria, Roger, and Novak created Grassroots Tennis, Inc. (GTI), which began operations on March...
-
Watch the video NOVA | Becoming Human (Part 3): Last Human Standing: and write a summary about this video http://www.pbs.org/wgbh/nova/evolution/becoming-human.html
-
Which financial statement is the most confusing to you and what tool/resource/website could you use as a resource to understand it better? Should all employees of a company have access to financial...
-
The accumulated earnings tax is a penalty intended to encourage distributions to shareholders. What would be considered "accumulated taxable income" for the year?
-
AP As the bakery manager at the local grocery store, Liam monitored the mix of products most popular with consumers. Just two years earlier, this store sold eight loaves of bread for each package of...
-
In what year did Congress enact the personal holding company provisions aimed at corporations controlled by a limited number of shareholders for the purpose of avoiding higher individual taxes?
-
Josh, CPA, reviews data collected from an audit client. Once Josh receives the data, he sorts the data, removes any duplicate data and reformats the data so that it is all consistent. What is this...
-
Consider two wires, one aluminum with resistivity 2.65 10 -8 m and one copper with resistivity 1.72 10 -8 m. Find the ratio of the diameter of aluminum to copper wire, if they have the same...
-
The purpose of this case is to come up with a contingency plan[s] in order to sustain the program Move With Me, a program that serves thousands of community members throughout Lower Manhattan. The...
-
On January 1, 2010, Ejez acquired 40% of the shares of Campbell for $65,880. At this date, the statement of financial position of Campbell consisted of: In relation to the assets of Campbell, the...
-
What type of organization would reflect collections on its financial statements?
-
Berke Company purchased equipment from Norway for 140,000 krones (NOK) on December 16, 2013, with payment due on February 14, 2014. On December 16, 2013, Berke also acquired a 60-day forward contract...
-
A running mountain lion can make a leap 10.0 m long, reaching a maximum height of 3.0 m. a. What is the speed of the mountain lion just as it leaves the ground? b. At what angle does it leave the...
-
Emily throws a soccer ball out of her dorm window to Allison, who is waiting below to catch it. If Emily throws the ball at an angle of 30 below horizontal with a speed of 12 m/s, how far from the...
-
In punting a football, the kicker tries to maximize both the distance of the kick and its hang timethe time that the ball is in the air. A kicker gets off a great punt with a hang time of 5.0 s that...
Study smarter with the SolutionInn App