0

Can you help on Simple Calculation(Goal!)?

You need to calculate the points earned by a soccer team. The team won 18 games and ended 7 games as a draw. A win brings 3 points,while a draw brings 1. Print((3*1)-18) ((3*1)-18)

10th Nov 2021, 7:46 AM
Shah Johan
10 Réponses
+ 6
Shah Johan If a win is worth 3 points & you have won 18 times, then win_points = 18 x 3 A draw is worth 1 point & you have 7 draws, then draw_points = 7x1 total_points = win_points + draw_points Try again, you are close. Let us know how you go
10th Nov 2021, 8:29 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
Please show you attempt with a question first.
10th Nov 2021, 8:14 AM
JaScript
JaScript - avatar
+ 1
Shah Johan Please post your code attempt, else it just looks like you want us to give you an answer
10th Nov 2021, 8:14 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
61 points
10th Nov 2021, 8:31 AM
Димитрашко Артем
+ 1
print(n_win*3+n_draw_*1)
10th Nov 2021, 8:56 AM
Sarthak
Sarthak - avatar
+ 1
Give each scores a variable games_won = (3 * 18) games_drawn= (1 * 7) print(games_won + games_drawn)
12th Nov 2021, 4:06 AM
Emmanuel Pascal
+ 1
# a win brings 3 points while a draw gets 1 point win = int(input("Enter number of matches won - ")) draw = int(input("Enter number of matches had draw - ")) print("Total points - " , (win*3) + (draw*1)) try this is it correct according to your question/code needed?
12th Nov 2021, 6:06 AM
Kunj Mandaviya
Kunj Mandaviya - avatar
0
print((3*1)-18)((3*1)-18)
10th Nov 2021, 8:21 AM
Shah Johan
0
Дімітрашко Артем Now see if you can write a code to get that answer. print(61) is not acceptable
10th Nov 2021, 8:32 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
I think you can do: int games, wins, draws,ans; cin >> games>>win>>draws; Then you would do the operations win*=3; ans = win - draw; cout << ans;
10th Nov 2021, 8:01 PM
Hugo Gaytán
Hugo Gaytán - avatar