Advertisement
kristiyanasimeonova

Untitled

Sep 18th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class newSolarship {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.         double income = Double.parseDouble(scanner.nextLine());
  8.         double grade = Double.parseDouble(scanner.nextLine());
  9.         double salary = Double.parseDouble(scanner.nextLine());
  10.         double successScholarship = 0;
  11.         double socialScholarship = 0;
  12.         if (salary > income) {
  13.             if (grade > 4.5) {
  14.                 socialScholarship = salary * 0.35; } }
  15.         if (grade >= 5.5) {
  16.             successScholarship = grade*25; }
  17.         if (socialScholarship > successScholarship) {
  18.             System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
  19.         } else if (socialScholarship < successScholarship) {
  20.             System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(successScholarship)); }
  21.         else { System.out.println("You cannot get a scholarship!");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement