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