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