Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- double income = Double.parseDouble(input.nextLine());
- double averageGrade = Double.parseDouble(input.nextLine());
- double minimumSalary = Double.parseDouble(input.nextLine());
- //scholarships
- double socialScholarship = 0.00;
- double excellentGradeScholarship = 0.00;
- // checking socialScholarship
- if ((minimumSalary>income) && (averageGrade>4.5)) {
- socialScholarship = minimumSalary*0.35;
- }
- // checking excellentGradeScholarship
- if (averageGrade>=5.5) {
- excellentGradeScholarship = averageGrade * 25;
- }
- if (socialScholarship==0 && excellentGradeScholarship==0) {
- System.out.printf("You cannot get a scholarship!");
- } else if (socialScholarship>0 && socialScholarship>excellentGradeScholarship) {
- System.out.printf("You get a Social scholarship %.0f BGN",Math.floor(socialScholarship));
- } else {
- System.out.printf("You get a scholarship for excellent results %.0f BGN",Math.floor(excellentGradeScholarship));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement