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