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 scan = new Scanner(System.in);
- double income = Double.parseDouble(scan.nextLine());
- double grade = Double.parseDouble(scan.nextLine());
- double minimumWage = Double.parseDouble(scan.nextLine());
- double socialScholarship = 0.35*minimumWage;
- double scholarship = grade*25;
- boolean social=false;
- if (income<minimumWage && grade > 4.50) {
- social = true;
- }
- if (income > minimumWage && grade < 5.50) {
- System.out.println("You cannot get a scholarship!");
- }
- else if (social && socialScholarship > scholarship) {
- System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
- }
- else if (grade >= 5.5 && scholarship > socialScholarship) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(scholarship));
- }
- else if (social==true && grade >= 5.50) {
- if (socialScholarship>scholarship) {
- System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
- }
- else {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(scholarship));
- }
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement