Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package IzpitZadachi.c_Third;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class Scholarship {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- double dohod = Double.parseDouble(reader.readLine());
- double uspeh = Double.parseDouble(reader.readLine());
- double minzaplata = Double.parseDouble(reader.readLine());
- Double socstipendia = 0.0;
- Double sixstipendia = 0.0;
- if (dohod < minzaplata) {
- if (uspeh >= 5.50) {
- sixstipendia = uspeh * 25;
- socstipendia = minzaplata * 0.35;
- } else if (uspeh >= 4.50) {
- socstipendia = minzaplata * 0.35;
- }
- } else {
- if (uspeh >= 5.50) {
- sixstipendia = uspeh * 25;
- }
- }
- if (socstipendia == 0 && sixstipendia == 0) {
- System.out.println("You cannot get a scholarship!");
- } else if (socstipendia > sixstipendia) {
- System.out.printf("You get a Social scholarship %.0f BGN", Math.floor(socstipendia));
- } else {
- System.out.printf("You get a scholarship for excellent results %.0f BGN", Math.floor(sixstipendia));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement