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