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