Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- 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 success= Double.parseDouble(scanner.nextLine());
- double salary= Double.parseDouble(scanner.nextLine());
- double socialScholarship = salary*0.35;
- double excellentScholarship = 25*success;
- if (income>salary || success<4.50){
- System.out.println("You cannot get a scholarship!");
- }
- else if (success>=5.50 && excellentScholarship>=socialScholarship) {
- System.out.printf("You get a scholarship for excellent results " + "%.0f" + " BGN", Math.floor(excellentScholarship));
- }
- else if(success>=5.50 && excellentScholarship<=socialScholarship)
- { System.out.printf("You get a Social scholarship " + "%.0f" +" BGN" , Math.floor(socialScholarship));
- }
- else if (success<5.50 && socialScholarship>excellentScholarship) {
- System.out.printf("You get a Social scholarship " + "%.0f" +" BGN" , Math.floor(socialScholarship));
- }
- else if (success<5.50 && socialScholarship<excellentScholarship) {
- System.out.printf("You get a Social scholarship " + "%.0f" + " BGN", Math.floor(excellentScholarship));
- }
- //else if (success<4.50){
- //System.out.println("You cannot get a scholarship!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement