Skip to content

fikrcamp/football-points

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Football Points

You have been hired by a football team to create a function that calculates their points based on the number of wins, draws and losses. The points system is as follows:

  • A win earns the team 3 points
  • A draw earns the team 1 point
  • A loss earns the team 0 points
Your Task πŸ˜ƒ:

Write a function called calculatePoints that takes in 3 arguments:

  • wins (a number): representing the number of wins the team has
  • draws (a number): representing the number of draws the team has
  • losses (a number): representing the number of losses the team has

The function should log the total number of points the team has earned based on the above points system.

Example

calculatePoints(5,2,3); // Output: 17

For example, if the team has won 5 games, drawn 2 games and lost 3 games, their total points would be: (5 x 3) + (2 x 1) + (3 x 0) = 17.

Your function should return the log 17.

Good Luck πŸ˜€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published