Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Lesson 12 Coding Activity 1
- * Write a program to input three integers.
- * Test if the average is greater than or equal to 89.5.
- * If so, print out the phrase "ABOVE AVERAGE" (without the quotes).
- */
- import java.util.Scanner;
- class Lesson_12_Activity_One {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- System.out.println("Enter 3 intergers: ");
- int x = scan.nextInt();
- int y = scan.nextInt();
- int z = scan.nextInt();
- double avg = ((x + y + z)/3.0);
- System.out.println(avg);
- if(avg >= 89.5)
- {
- System.out.println("ABOVE AVERAGE");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement