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