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