Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 24.04.2021
- import java.util.Scanner;
- public class Ex03B {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner in = new Scanner(System.in);
- // double sa3at ;
- // double ajrSa3a;
- // double ajrShahri;
- double sa3at, ajrSa3a, ajrShahri;
- double mefra3a;
- System.out.print("number of hours: ");
- sa3at = in.nextDouble();
- System.out.print("price for hour: ");
- ajrSa3a = in.nextDouble();
- System.out.print("mefra3a: ");
- mefra3a = in.nextDouble();
- // שעות נוספות
- if (sa3at > 160) {
- double overTime = sa3at - 160;
- double overPrice = 1.25 * ajrSa3a;
- double overSalary = overTime * overPrice;
- ajrShahri = 160 * ajrSa3a + overSalary;
- } else {
- ajrShahri = sa3at * ajrSa3a - mefra3a;
- }
- System.out.println("Toatal salary = " + ajrShahri);
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement