Ade is a football player who played 10 matches this season. In each match, he scored 2 goals. He also received a total of 3 yellow cards during the season.
Task:
Type Ade’s name and store it in a variable called name
.
Store the number of matches played in a variable called matches
and set it to 10.
Store the goals per match in a variable called goals_per_match
and set it to 2.
Store the total yellow cards in a variable called yellow_cards
and set it to 3.
Calculate the total goals by multiplying matches
by goals_per_match
.
Calculate the goal difference by subtracting yellow_cards
from the total goals.
Calculate the average goals per match by dividing total goals by matches.
Print a message that includes Ade’s name, total goals, goal difference, and average goals per match.
We’re always looking for international STEM educators to join our team. If you are interested, please send us a mail and we’ll get back to you!
If you have any questions, kindly send us a mail. Don’t forget to follow and like all our social accounts to get updates on competitions!