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 success = Double.parseDouble(scanner.nextLine());
- double salary = Double.parseDouble(scanner.nextLine());
- double socialScholarship = salary * 0.35;
- double excellentScholarship = 25 * success;
- if (success < 4.50) {
- System.out.println("You cannot get a scholarship!");
- } else if (success < 5.50){
- if (income > salary) {
- System.out.println("You cannot get a scholarship!");
- } else if (socialScholarship > excellentScholarship) {
- System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(socialScholarship));
- } else if (socialScholarship < excellentScholarship) {
- System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(excellentScholarship));
- }} else if (success >= 5.50) {
- if (excellentScholarship >= socialScholarship) {
- System.out.printf("You get a scholarship for excellent results " + "%.0f" + " BGN", Math.floor(excellentScholarship));
- } else if (excellentScholarship <= socialScholarship) {
- System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(socialScholarship));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment