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