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