Advertisement
DeniGS

Untitled

May 26th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Schoolarship {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6.  
  7. double income = Double.parseDouble(scan.nextLine());
  8. double avUspeh = Double.parseDouble(scan.nextLine());
  9. double minSalary = Double.parseDouble(scan.nextLine());
  10. double socialSc = 0;
  11. double exelentResults =0;
  12.  
  13. if(income<minSalary && avUspeh > 4.5){
  14. socialSc = Math.floor(minSalary * 0.35);
  15.  
  16. }
  17. if(avUspeh >= 5.5){
  18. exelentResults = Math.floor(avUspeh * 25);
  19.  
  20. }if(socialSc > exelentResults){
  21. System.out.printf("You get a Social scholarship %.0f BGN",socialSc);
  22. }else if(exelentResults>socialSc){
  23. System.out.printf("You get a Social scholarship %.0f BGN",exelentResults);
  24. }else{
  25. System.out.println("You cannot get a scholarship!");
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement