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