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