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)
10 Respuestas
+ 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
+ 2
Please show you attempt with a question first.
+ 1
Shah Johan
Please post your code attempt, else it just looks like you want us to give you an answer
+ 1
61 points
+ 1
print(n_win*3+n_draw_*1)
+ 1
Give each scores a variable
games_won = (3 * 18)
games_drawn= (1 * 7)
print(games_won + games_drawn)
+ 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?
0
print((3*1)-18)((3*1)-18)
0
Дімітрашко Артем
Now see if you can write a code to get that answer.
print(61) is not acceptable
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;