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