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