Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- 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 achievement = Double.parseDouble(scanner.nextLine());
- double mrz = Double.parseDouble(scanner.nextLine());
- double socialScholarship = 0.0;
- double achievementsScholarship = 0.0;
- if (achievement >= 5.5) {
- achievementsScholarship = achievement * 25;
- }
- if (achievement > 4.5) {
- if (income < mrz) {
- socialScholarship = mrz * 0.35;
- }
- }
- if (socialScholarship + achievementsScholarship == 0.0) {
- System.out.println("You cannot get a scholarship!");
- } else if (socialScholarship > achievementsScholarship) {
- System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
- } else {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", achievementsScholarship);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement