Create a function that takes the number of wins, draws and losses and calculates the number of points a football team has obtained so far.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Wins:");
int wins = in.nextInt();
System.out.println("Draws:");
int draws = in.nextInt();
System.out.println("Losses:");
int losses = in.nextInt();
System.out.println("Points: " + (wins * 3 + draws));
}
}
Comments
Leave a comment