Skip to content

Instantly share code, notes, and snippets.

@peter279k
Created May 21, 2017 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peter279k/d99ef67828408499a9cfd914c4da5ab5 to your computer and use it in GitHub Desktop.
Save peter279k/d99ef67828408499a9cfd914c4da5ab5 to your computer and use it in GitHub Desktop.
TQC+ JAVA
import java.util.Scanner;
public class JPA01 {
public static void main(String []args) {
Scanner input = new Scanner(System.in);
System.out.println("Please input:");
int numOne = input.nextInt();
int numTwo = input.nextInt();
int numThree = input.nextInt();
double avg = (double)(numOne + numTwo + numThree) / 3.0;
System.out.printf("Average: %.2f\r\n", avg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment