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