Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Scholarship {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double agreements = Double.parseDouble(scanner.nextLine());
- double middleGoodLuck = Double.parseDouble(scanner.nextLine());
- double miniWorkSalary = Double.parseDouble(scanner.nextLine());
- double social = 0;
- double exelent = 0;
- if (miniWorkSalary < agreements && middleGoodLuck < 5.50) {
- System.out.printf("You cannot get a scholarship!");
- } else if (miniWorkSalary > agreements && middleGoodLuck >= 4.50) {
- social = 0.35 * miniWorkSalary;
- } else if (middleGoodLuck >= 5.50) {
- exelent = middleGoodLuck * 25;
- }
- if (social > exelent) {
- System.out.printf("You get a Social scholarship %.0f BGN %n", Math.floor(social));
- }
- if (exelent > social){
- System.out.printf("You get a scholarship for excellent result %f BGN", Math.floor(exelent));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement