2. Judo is a type martial art that became an Olympic sport in 1964. Write a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Judo is a type martial art that became an Olympic sport in 1964. Write a program that determines the winners of individual Olympic Judo matches. Judo has two technical scores: An Ippon is a terminating score. Only one can be scored and the match is terminated. A Waza-ari is an accumulation score. There is always a winner in Judo match (no ties). The points given will reflect the score differential or winning score. In Judo the highest quality score wins, so the scoreboard is laid out left to right to show the score like a number. Scores are from highest to lowest quality moving from left to right. The contestants are referred to by the color of the robes they wear: blue or white. I Blue White 1 W 2 On the scoreboard above, white's single ippon beats the lesser quality of blue's 2 waza-ari thus wins the match. Therefore, scoring in Judo is lexicographic- an ippon beats any number of waza-ari. In regular time, a contest can only be won by a technical score or scores. A penalty or penalties will not decide the winner except for a hansoku-make (direct or indirect). Penalties are either minor (shido) or major (hansoku-make). A maximum of three shido can be given in a contest. The third shido becomes a hansoku-make (indirect) and the contest is stopped, and the opponent will be awarded an ippon. All leg grabbing actions will be penalized by shido for the first offense and hansoku-make for the second offense, and the opponent will be awarded an ippon. A direct (immediate) hansoku-make can be given and the player is excluded from the contest; the opponent will be awarded an ippon. In a case where there is no score or scores are equal, the contest will continue in overtime (Golden Score). Any score or scores and/or penalties will remain on the scoreboard. In Golden Score penalties can be used to determine the contest winner in Golden Score. The decision in Golden Score is made by the difference of scores or shido. If an athlete receives a shido during Golden Score that make his/her score total of shidos greater than that of the opponent, the contest will conclude by that shido. Penalties are denoted in the rightmost column on a judo scoreboard. Input will come from a text file. 2 The first line of input will contain a single integer n which will contain how many matches to follow. For each match, there will be two lines with each line containing: • The players color followed by a space where the first number(s) indicate an ippon followed by a single space, followed by the number of waza-ari followed by a single space, the number of penalties earned in the game, then one space followed by a final column, where a value: 1. indicates leg grabbing 2. indicates a direct hansoku-make X- indicates Golden Score Otherwise a (-) dash is the default. Output to the screen: the particular match, a scoreboard, the winning player's color and the winning grade. On the score board, penalties are designated with a letter S before the number, and a hansoku- make is designated with the letter H only and special shido designated by the letter L only. Golden Score (GS) should also be noted. Separate the matches with a blank line. Let the user input the file name from the keyboard. Refer to the sample output below. Sample File: 3 Blue 1 0 0 - White 0 1 0 - Blue 0 1 2 - White 0 0 1 - Blue 0 2 1 - White 1 2 1 X Sample Run: Enter the file name: judo.txt Match 1: IW P Blue 100 White: 0 1 0 ===== ===== Blue winner by Ippon Match 2: I W P Blue: 0 1 S2 White: 0 0 S1 ========= ===== Blue winner by Waza-ari Match 3: I W P Blue: 0 2 S1 White: 1 2 S1 GS =============== White winner by Ippon 2. Judo is a type martial art that became an Olympic sport in 1964. Write a program that determines the winners of individual Olympic Judo matches. Judo has two technical scores: An Ippon is a terminating score. Only one can be scored and the match is terminated. A Waza-ari is an accumulation score. There is always a winner in Judo match (no ties). The points given will reflect the score differential or winning score. In Judo the highest quality score wins, so the scoreboard is laid out left to right to show the score like a number. Scores are from highest to lowest quality moving from left to right. The contestants are referred to by the color of the robes they wear: blue or white. I Blue White 1 W 2 On the scoreboard above, white's single ippon beats the lesser quality of blue's 2 waza-ari thus wins the match. Therefore, scoring in Judo is lexicographic- an ippon beats any number of waza-ari. In regular time, a contest can only be won by a technical score or scores. A penalty or penalties will not decide the winner except for a hansoku-make (direct or indirect). Penalties are either minor (shido) or major (hansoku-make). A maximum of three shido can be given in a contest. The third shido becomes a hansoku-make (indirect) and the contest is stopped, and the opponent will be awarded an ippon. All leg grabbing actions will be penalized by shido for the first offense and hansoku-make for the second offense, and the opponent will be awarded an ippon. A direct (immediate) hansoku-make can be given and the player is excluded from the contest; the opponent will be awarded an ippon. In a case where there is no score or scores are equal, the contest will continue in overtime (Golden Score). Any score or scores and/or penalties will remain on the scoreboard. In Golden Score penalties can be used to determine the contest winner in Golden Score. The decision in Golden Score is made by the difference of scores or shido. If an athlete receives a shido during Golden Score that make his/her score total of shidos greater than that of the opponent, the contest will conclude by that shido. Penalties are denoted in the rightmost column on a judo scoreboard. Input will come from a text file. 2 The first line of input will contain a single integer n which will contain how many matches to follow. For each match, there will be two lines with each line containing: • The players color followed by a space where the first number(s) indicate an ippon followed by a single space, followed by the number of waza-ari followed by a single space, the number of penalties earned in the game, then one space followed by a final column, where a value: 1. indicates leg grabbing 2. indicates a direct hansoku-make X- indicates Golden Score Otherwise a (-) dash is the default. Output to the screen: the particular match, a scoreboard, the winning player's color and the winning grade. On the score board, penalties are designated with a letter S before the number, and a hansoku- make is designated with the letter H only and special shido designated by the letter L only. Golden Score (GS) should also be noted. Separate the matches with a blank line. Let the user input the file name from the keyboard. Refer to the sample output below. Sample File: 3 Blue 1 0 0 - White 0 1 0 - Blue 0 1 2 - White 0 0 1 - Blue 0 2 1 - White 1 2 1 X Sample Run: Enter the file name: judo.txt Match 1: IW P Blue 100 White: 0 1 0 ===== ===== Blue winner by Ippon Match 2: I W P Blue: 0 1 S2 White: 0 0 S1 ========= ===== Blue winner by Waza-ari Match 3: I W P Blue: 0 2 S1 White: 1 2 S1 GS =============== White winner by Ippon
Expert Answer:
Related Book For
Essentials of Marketing
ISBN: 978-0078028885
13th edition
Authors: William D. Perreault, Joseph P. Cannon
Posted Date:
Students also viewed these programming questions
-
Write a program that determines the change given back to a customer in a self-service checkout machine of a supermarket for purchases of up to $50. The program generates a random number between 0.01...
-
Write a program that determines the name of a shape from its number of sides. Read the number of sides from the user and then report the appropriate name as part of a meaningful message. Your program...
-
Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and a dollar, in 5 cent increments (25, 30, 35, , 90, 95, or 100),...
-
Lauren Smith was relaxing after work with a colleague at a local bar. After a few drinks, she began expressing her feelings about her company's new control initiatives. It seems that as a result of...
-
Which of the major stages in the issues management process do you think is the most important? Why?
-
A train traveling at a constant speed v = 25 mi/hr has entered a circular portion of track with a radius R = 200 ft. Determine the velocity and acceleration of point A of the train as observed by the...
-
Rework the decision problem in Example 7, supposing that only 3 of the 20 hard drives required repairs within the first year. Data From Example 7 EXAMPLE 7 Comparing four detergents using an F test...
-
In Figure, a chain consisting of five links, each of mass 0.100 kg, is lifted vertically with constant acceleration of magnitude a = 2.50 m/s2. Find the magnitudes of (a) The force on link 1 from...
-
Question 13 (1 point) Saved For an x-bar chart where the standard deviation () is known, the Upper Control Limit (UCL) with a 99.73% confidence level is
-
Overview The milestone for Project One involves applying accounting principles and methods to long-term liabilities and equity. You will also evaluate these financial statement components for...
-
You are an Audit Manager in the firm UPSY Chartered Accountants, a firm in public practice registered with the Institute of Chartered Accountants (Ghana). Bank of Ghana has appointed your firm to...
-
Students form pairs. One student takes the role of Pamela Johnson; the other, the role of an HRM consultant Johnson has hired to help her decide what to do next. Role-play the meeting between the...
-
A big challenge for the GM managers at the auto plant making the Chevrolet Sonic will be maintaining positive employee morale. They will be managing a workforce of 1,550 employees that is composed of...
-
There is much in the literature on gainsharing and profit sharing, and one of the key issues is the extent to which any money generated by that incentive plan should be divided equally among...
-
In a role-playing exercise, one of the students is asked to take the position in favor of heavy reliance on internal referrals, in particular by combing social sites. Another student is asked to...
-
The HR director of an investment bank has called a meeting of senior employees to discuss the years bonuses. While rival banks are giving out bonuses of over $3 million to each senior employee, the...
-
3 4 planning his retirement 25 years from now. He plans to save an equal amount each month for the next 25 years (ordinary annuity). His investment will earn 8.0 percent compounded monthly. Max will...
-
Danielle has an insurance policy with a premium of $75 per month. In September she is in an accident and receives a bill worth $2990 for the repair of her own property. Her deductible is $250 and her...
-
What are the effective annual interest rates for the following cash discount terms: (a) 1/10, net 20; (b) 1/5, net 10; (c) Net 25?
-
Are the benefits and limitations of a canned presentation any different if it is supported with a PowerPoint presentation or DVD than if it is just a person talking? Why or why not?
-
What would happen if retailer-organized channels (either formally integrated or administered) dominated consumer products marketing?
-
Allister Company uses both debt capital and equity capital to fund new projects. The before-tax cost of debt capital is 12 percent. The cost of equity capital is 10 percent. Allister's effective tax...
-
Use an Internet search engine to identify three companies or agencies that use present worth analysis to make business decisions as evidenced in their annual reports.
-
Use the Internet to access ConocoPhillips's most recent annual report. a. What evidence do you find that ConocoPhillips continues to rely on present worth analysis in its corporate decision making?...
Study smarter with the SolutionInn App