Write a program that calculates the points earned by a soccer team. The program reads from the user th number of games the team won and the number of games ended as a draw. Note that a win brings 3 points t 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 is 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 Using java Your expectation is so close Sample Run 2: Enter the numbe. l 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
Write a program that calculates the points earned by a soccer team. The program reads from the user th number of games the team won and the number of games ended as a draw. Note that a win brings 3 points t 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 is 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 Using java Your expectation is so close Sample Run 2: Enter the numbe. l 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
Chapter4: Making Decisions
Section: Chapter Questions
Problem 5E: a. Write a program named CheckMonth that prompts a user to enter a birth month. If the value entered...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning