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