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);
- double dohod = Double.parseDouble(scanner.nextLine());
- double avUspeh = Double.parseDouble(scanner.nextLine());
- double minSalary = Double.parseDouble(scanner.nextLine());
- double uspehScholarship = Math.floor(avUspeh * 25);
- double socialScholarship = Math.floor(minSalary * 0.35);
- if (avUspeh < 4.5) {
- if (dohod > minSalary) {
- System.out.println("You cannot get a scholarship!");
- } else if (dohod <= minSalary) {
- System.out.println("You cannot get a scholarship!");
- }
- } else if (avUspeh >= 4.5 && avUspeh < 5.5) {
- if (dohod > minSalary) {
- System.out.println("You cannot get a scholarship!");
- } else if (dohod <= minSalary) {
- System.out.printf("You get a Social scholarship %.0f BGN",socialScholarship);
- }
- }
- if (avUspeh >= 5.5) {
- double maxScholarship = Math.max(uspehScholarship, socialScholarship);
- if (maxScholarship == socialScholarship) {
- System.out.printf("You get a Social scholarship %.0f BGN",socialScholarship);
- } else if (maxScholarship == uspehScholarship) {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", uspehScholarship);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement