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