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