Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Anatoliy on 10.07.2016.
- * Task 5.1.6
- */
- import java.util.Scanner;
- public class Task9 {
- public static void main(String[] args) {
- double average;
- int daysAbsent;
- boolean exempt = false;
- Scanner reader = new Scanner(System.in);
- System.out.println("This program will determine if you can get out of the final exam.");
- System.out.println("Please answer the following questions.");
- System.out.println("What is your average in the class?");
- average = reader.nextDouble();
- System.out.println("How class lectures have you missed?");
- daysAbsent = reader.nextInt();
- if ((average >= 90 && daysAbsent <= 3) || (average >= 80 && daysAbsent <= 0)) {
- exempt = true;
- System.out.println("Congratulations! You are exempt from the final exam.");
- }
- else
- {
- exempt = false;
- System.out.println("You are not exempt from the final exam.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement