Advertisement
mmayoub

Untitled

Apr 25th, 2021
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1.  
  2.  
  3. // 24.04.2021
  4. import java.util.Scanner;
  5.  
  6. public class Ex03 {
  7.  
  8.     public static void main(String[] args) {
  9.         // TODO Auto-generated method stub
  10.  
  11.         Scanner in = new Scanner(System.in);
  12.  
  13.         // double sa3at ;
  14.         // double ajrSa3a;
  15.         // double ajrShahri;
  16.  
  17.         double sa3at, ajrSa3a, ajrShahri;
  18.         double mefra3a;
  19.         System.out.print("number of hours: ");
  20.         sa3at = in.nextDouble();
  21.  
  22.         System.out.print("price for hour: ");
  23.         ajrSa3a = in.nextDouble();
  24.  
  25.         System.out.print("mefra3a: ");
  26.         mefra3a = in.nextDouble();
  27.  
  28.         ajrShahri = sa3at * ajrSa3a - mefra3a;
  29.  
  30.         // שעות נוספות
  31.         if (sa3at > 160) {
  32.             double overTime = sa3at - 160;
  33.             double overPrice = 0.25 * ajrSa3a;
  34.             double overSalary = overTime * overPrice;
  35.  
  36.             ajrShahri = ajrShahri + overSalary;
  37.         }
  38.  
  39.         System.out.println("Toatal salary = " + ajrShahri);
  40.  
  41.         in.close();
  42.     }
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement