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 scanner = new Scanner(System.in);
- //Доход в лева - реално число в интервала [0.00..6000.00]
- //2. Среден успех - реално число в интервала [2.00...6.00]
- //3. Минимална работна заплата - реално число в интервала
- double incomeLeva = Double.parseDouble(scanner.nextLine());
- double averageGrade = Double.parseDouble(scanner.nextLine());
- double minimalIncome = Double.parseDouble(scanner.nextLine());
- if (incomeLeva < minimalIncome && averageGrade > 4.5) {
- double input1 = minimalIncome * 0.35;
- System.out.printf("You get a Social scholarship %.0f BGN", input1);
- } else if (averageGrade > 5.5) {
- double input2 = Math.round(averageGrade * 25);
- System.out.printf("You get a scholarship for excellent results %.2f BGN", input2);
- } else {
- System.out.println("You cannot get a scholarship!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement