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 scan = new Scanner(System.in);
- double salary = Double.parseDouble(scan.nextLine());
- double uspeh = Double.parseDouble(scan.nextLine());
- double minSalary = Double.parseDouble(scan.nextLine());
- double socialScholarship = minSalary * 0.35;
- double scholarship = uspeh * 25;
- if (uspeh >= 5.50 && salary < minSalary && socialScholarship >= scholarship) {
- System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
- } else if (uspeh >= 5.50 && salary < minSalary && socialScholarship < scholarship) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(scholarship));
- } else if (uspeh >= 4.50 && salary < minSalary) {
- System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
- } else if (uspeh >= 5.50) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(scholarship));
- } else {
- System.out.printf("You cannot get a scholarship!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement