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