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