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 pay = Double.parseDouble(scanner.nextLine());
- double grade = Double.parseDouble(scanner.nextLine());
- double minWage = Double.parseDouble(scanner.nextLine());
- double bScholarship = 0;
- double aScholarship = 0;
- if (grade > 4.5) {
- if (pay < minWage) {
- bScholarship = minWage * 0.35;
- } if (grade >= 5.5) {
- aScholarship = grade * 25;
- if (aScholarship >= bScholarship) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(aScholarship));
- }
- }
- }
- if (bScholarship != 0) {
- if (bScholarship > aScholarship) {
- System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(bScholarship));
- }
- } else {
- if (aScholarship == 0) {
- System.out.println("You cannot get a scholarship!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement