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 income = Double.parseDouble (scanner.nextLine ());
- double grade = Double.parseDouble (scanner.nextLine ());
- double minWage = Double.parseDouble (scanner.nextLine ());
- double socialScholarship = 0;
- double excellentScholarship = 0;
- boolean getScholarship = false;
- if (income < minWage && grade > 4.50) {
- socialScholarship = Math.floor (minWage * 0.35);
- getScholarship = true;
- }
- if (grade >= 5.50) {
- excellentScholarship = Math.floor (grade * 25);
- getScholarship = true;
- }
- if (getScholarship) {
- if (excellentScholarship > socialScholarship) {
- System.out.printf ("You get a scholarship for excellent results %.0f BGN", excellentScholarship);
- }
- else
- System.out.printf ("You get a Social scholarship %.0f BGN", socialScholarship);
- }
- else {
- System.out.println("You cannot get a scholarship!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement