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