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