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 sc = new Scanner(System.in);
- double income = sc.nextDouble();
- double averageGrades = sc.nextDouble();
- double minimalWage = sc.nextDouble();
- double socialScholarship = 0;
- double excellentNotesScholarship = 0;
- if (income < minimalWage && averageGrades > 4.5) {
- socialScholarship = Math.floor(0.35 * minimalWage);
- }
- if (averageGrades >= 5.5) {
- excellentNotesScholarship = Math.floor(averageGrades * 25);
- }
- if (socialScholarship > excellentNotesScholarship) {
- System.out.println("You get a Social scholarship " + (int) socialScholarship + " BGN");
- } else if (excellentNotesScholarship > socialScholarship) {
- System.out.println("You get a scholarship for excellent results " + (int) excellentNotesScholarship + " BGN");
- } else {
- System.out.println("You cannot get a scholarship!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement