Answer to Question #301453 in Java | JSP | JSF for joe

Question #301453

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.



1
Expert's answer
2022-02-23T12:19:07-0500
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));
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS