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