Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Scolarship {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- System.out.print("Enter min. salary: ");
- int minSalary = keyboard.nextInt();
- System.out.print("Enter family's income: ");
- int familyIncome = keyboard.nextInt();
- System.out.print("Enter family members: ");
- int familyMembers = keyboard.nextInt();
- double incomePerMember = familyIncome / familyMembers;
- System.out.print("Enter pupil's average success: ");
- double success = keyboard.nextDouble();
- double socialScholarship = minSalary * 0.35;
- double successScholarship = success * 35;
- if (success < 4.50) {
- System.out.println("You do not receive any scholarship.");
- } else if ((4.50 <= success) && (success < 5.50 ) && (incomePerMember > minSalary)){
- System.out.println("You do not receive social scholarship.");
- } else if ((4.50 <= success) && (success < 5.50 ) && (incomePerMember < minSalary)) {
- System.out.printf("You receive social scholarship of %.2f BGN.", socialScholarship);
- } else if ( (5.50 <= success) && (socialScholarship >= successScholarship) ) {
- System.out.printf("You receive social scholarship of %.2f BGN", socialScholarship);
- } else if ( (5.50 <= success) && (socialScholarship < successScholarship) ) {
- System.out.printf("You receive scholarship for excellent success of %.2f BGN.", successScholarship);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement