Problem #1: [35 pts] Write a program that calculates the points earned by a soccer team....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem #1: [35 pts] Write a program that calculates the points earned by a soccer team. The program reads from the user the number of games the team won and the number of games ended as a draw. Note that a win brings 3 points to the team and a draw brings 1 pt. Your program also prompts the user to enter the number of expected points and displays a message "Your expectation is so close" if the difference between the earned points and the expected points less than 5. Otherwise, it prints "The points difference is higher than 5" Sample Run 1: Enter the number of games won: 20 Enter the number of draws: 7 The team earned 67 points Enter the expected points for the matches: 70 Your expectation is so close Sample Run 2: Enter the number of games won: 2 Enter the number of draws: 10 The team earned 16 points Enter the expected points for the matches: 9 The points difference is higher than 5 The points difference is higher than 5 Problem #1: [35 pts] Write a program that calculates the points earned by a soccer team. The program reads from the user the number of games the team won and the number of games ended as a draw. Note that a win brings 3 points to the team and a draw brings 1 pt. Your program also prompts the user to enter the number of expected points and displays a message "Your expectation is so close" if the difference between the earned points and the expected points less than 5. Otherwise, it prints "The points difference is higher than 5" Sample Run 1: Enter the number of games won: 20 Enter the number of draws: 7 The team earned 67 points Enter the expected points for the matches: 70 Your expectation is so close Sample Run 2: Enter the number of games won: 2 Enter the number of draws: 10 The team earned 16 points Enter the expected points for the matches: 9 The points difference is higher than 5 The points difference is higher than 5
Expert Answer:
Answer rating: 100% (QA)
Here is the python code def calculatepoints Get the number of wins and draws from the user wins intinputEnter the number of games won draws intinputEn... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Valenzuela Corporations financial position is represented by the nine balances shown on the first line of the following schedule ($ in thousands). Assume that a single transaction took place for each...
-
For rigid-body motion, the strains will vanish. Under these conditions, integrate the straindisplacement relations (7.6.1) to show that the most general form of a rigid-body motion displacement field...
-
One of the larger species of tarantulas is the Grammostola mollicoma, whose common name is the Brazilian giant tawny red. A tarantula has two body parts. The anterior part of the body is covered...
-
James Chesser, process engineer, knows that the acceptance of a new process design will depend on its economic feasibility. The new process is designed to improve environmental performance. On the...
-
In 1940, the family of Thomas Back entered into an oil-and-gas lease with the Inland Gas Corporation. The lease held that Inland would pay to Backs family 12 cents per thousand cubic feet of gas...
-
The comparative balance sheet of Flack Inc. for December 31, 2013 and 2012, is shown as follows: The following additional information was taken from the records: a. The investments were sold for...
-
If it takes 4 seconds to mentally scan the distance between two locations 6 inches apart on a map, how long should it take to mentally scan locations that are 3 inches apart?
-
determine the magnitude and sense (direction) of the current in the 10 ohms resistor when I= 1.8 A
-
List the criteria that must be met before an expenditure can be considered as an allowable trade or business tax deduction.
-
Jason is single and uses the calendar year for his tax year. He died on May 15, 2019. When is his final income tax return due?
-
An individual surrenders, for $20,000, an endowment life insurance policy in which he had a $15,000 investment. How much of the $20,000 of proceeds must be included in gross income?
-
What is the negligence penalty?
-
What is the current status of Rey. Rul. 57-82?
-
Question (4): ( 12 Points) If Y has a binomial distribution with parameters n and p, then p Y is an unbiased Y +1 estimator of p. Another estimator of p is p n+2 a Derive the bias of p, - b Derive...
-
Why can wastewater treatment requirements in Hawaii be less stringent than those in most locations on the U.S. mainland?
-
The folium of Descartes is the graph shown in the figure. In parametric form its equation is given by: x = 3t/1 + t3 and y = 3t2/1 + t3 for t 1 (a) Use MATLAB to show that the equation of the folium...
-
An isosceles triangle sign is designed to have a triangular printed area of 600 in.2 (shaded area with a base length of a and height of h in the figure). As shown in the figure, there is a 2 in. gap...
-
A cross section of a river with measurements of its depth at intervals of 40 ft: is shown in the figure. Use numerical integration to estimate the cross-sectional area of the river. 607179 49442794 62
-
Discuss the importance of validity and research design. Next, choose one type of validity (internal, external, construct, or statistical conclusion) and discuss its relevance to experimental, quasi...
-
Explain from a technical viewpoint why it is important to distinguish a method, research, approach, and design. Next, briefly discuss how understanding each term individually in addition to how these...
-
Define the two major types of sampling strategies .
Study smarter with the SolutionInn App