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 scan = new Scanner(System.in);
- double income = Double.parseDouble(scan.nextLine());
- double averageSuccess = Double.parseDouble(scan.nextLine());
- double minimalSalary = Double.parseDouble(scan.nextLine());
- double social = Math.floor(minimalSalary * 0.35);
- double scholarship = Math.floor(averageSuccess * 25);
- if (income > minimalSalary & averageSuccess < 4.5) {
- System.out.println("You cannot get a scholarship!");
- } else if (income > minimalSalary & averageSuccess >= 4.5 & averageSuccess < 5.5){
- System.out.println("You cannot get a scholarship!");
- } else if (income > minimalSalary & averageSuccess >= 5.5) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", scholarship);
- } else if (income <= minimalSalary & averageSuccess < 4.5){
- System.out.println("You cannot get a scholarship!");
- } else if (income <= minimalSalary & averageSuccess >= 4.5 & averageSuccess < 5.5) {
- System.out.printf("You get a Social scholarship %.0f BGN", social);
- } else if (income <= minimalSalary & averageSuccess >= 4.5) {
- if (averageSuccess < 5.5){
- System.out.printf("You get a Social scholarship %.0f BGN", social);
- } else if (social < scholarship){
- System.out.printf("You get a scholarship for excellent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement