Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Scholarship3{
- 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 minWage = Double.parseDouble(scanner.nextLine());
- double socialScholarship = Math.floor(minWage * 0.35);
- double excellentScholarship = Math.floor(averageSuccess * 25);
- if (averageSuccess >= 5.5 && socialScholarship >= excellentScholarship && income < minWage) {
- System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
- } else if (averageSuccess >= 5.5 && socialScholarship < excellentScholarship && income < minWage) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", excellentScholarship);
- }
- if (averageSuccess < 4.5) {
- System.out.print("You cannot get a scholarship!");
- } else if (income > minWage) {
- System.out.print("You cannot get a scholarship!");
- } else if (averageSuccess <5.5 && averageSuccess >= 4.5 && income < minWage){
- System.out.printf("You get a Social scholarship %.0f BGN", socialScholarship);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement