mmayoub

Ex04, 2404.2021

Apr 27th, 2021
437
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package prj24042021;
  2.  
  3. // 24.04.2021
  4. import java.util.Scanner;
  5.  
  6. public class Ex04 {
  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, ajrSa3a, ajrShahri;
  14.  
  15.         System.out.print("number of hours: ");
  16.         sa3at = in.nextDouble();
  17.  
  18.         System.out.print("price for hour: ");
  19.         ajrSa3a = in.nextDouble();
  20.  
  21.         ajrShahri = sa3at * ajrSa3a;
  22.  
  23.         System.out.println("Toatal salary = " + ajrShahri);
  24.  
  25.         // start ex04
  26.         double khasem; // 2% = 0.02
  27.         double company; // 8% = 0.08
  28.  
  29.         khasem = 0.02 * ajrShahri;
  30.         System.out.println("Khasem letawfeer: " + khasem);
  31.  
  32.         company = 0.08 * ajrShahri;
  33.         System.out.println("company will pay: " + company);
  34.         System.out.println("tawfeer = " + (khasem + company));
  35.  
  36.         System.out.println("Neto = " + (ajrShahri - khasem));
  37.         in.close();
  38.     }
  39. }
  40.  
RAW Paste Data