Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ConditionalStatements;
- import java.util.Scanner;
- public class Scholarship {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double incomeLv = Double.parseDouble(scanner.nextLine());
- double averageGrade = Double.parseDouble(scanner.nextLine());
- double minSalary = Double.parseDouble(scanner.nextLine());
- int socialHave = 0;
- int excellentHave = 0;
- double grade = Math.floor(averageGrade * 25);
- double social = minSalary * 0.35;
- if (averageGrade >= 5.50) {
- excellentHave = 1;
- }
- if (incomeLv < minSalary && averageGrade > 4.50) {
- socialHave = 1;
- }
- if (socialHave ==1 && excellentHave == 1 && social > grade) {
- System.out.printf("You get a Social scholarship %.0f BGN",Math.floor(social));
- } else if (socialHave ==1 && excellentHave == 1 && social < grade){
- System.out.printf("You get a scholarship for excellent results %.0f BGN",Math.floor(grade));
- } else if (averageGrade >= 5.50) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN",Math.floor(grade));
- } else if (incomeLv < minSalary && averageGrade > 4.50) {
- System.out.printf("You get a Social scholarship %.0f BGN",Math.floor(social));
- } else {
- System.out.println("You cannot get a scholarship!");
- }
- }
- }
Add Comment
Please, Sign In to add comment