Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class newSolarship {
- 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 salary = Double.parseDouble(scanner.nextLine());
- double successScholarship = 0;
- double socialScholarship = 0;
- if (salary > income) {
- if (grade > 4.5) {
- socialScholarship = salary * 0.35; } }
- if (grade >= 5.5) {
- successScholarship = grade*25; }
- if (socialScholarship > successScholarship) {
- System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socialScholarship));
- } else if (socialScholarship < successScholarship) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(successScholarship)); }
- else { System.out.println("You cannot get a scholarship!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement