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