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 score = Double.parseDouble(scanner.nextLine());
- double minWage = Double.parseDouble(scanner.nextLine());
- double socialScholarship = 0;
- double scoreScholarship = 0;
- double scholarship = 0;
- if (5.5 <= score) {
- scoreScholarship = score * 25;
- }
- if (income < minWage && 4.5 < score) {
- socialScholarship = minWage * 0.35;
- }
- if (socialScholarship == 0 && scoreScholarship == 0){
- System.out.println("You cannot get a scholarship!");
- } else if (socialScholarship <= scoreScholarship) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(scoreScholarship));
- } else {
- System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement