mmayoub

Ex04, 17.04.2021

Apr 20th, 2021 (edited)
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. // 17.04.2021
  2. import java.util.Scanner;
  3.  
  4. public class Ex04 {
  5.  
  6.     public static void main(String[] args) {
  7.         // TODO Auto-generated method stub
  8.         Scanner in = new Scanner(System.in);
  9.  
  10.         double a; // שכר עבודה ללא בונוס
  11.         double bonus; // בונוס חד פעמי לעובד
  12.         double total; // שכר עם בונוס
  13.  
  14.         // קליטת השכר מהמשתמש
  15.         System.out.print("הכנס משכורת חודשית: ");
  16.         a = in.nextDouble();
  17.  
  18.         // עיבוד נתונים
  19.         bonus = 112.0 / 100; // bonus = 1.12;
  20.         total = a * bonus; // total = a * 112/100;
  21.  
  22.         // הדפסת תוצאות
  23.         System.out.println("בונוס = " + bonus);
  24.         System.out.println("שכר ללא בונוס: " + a);
  25.         System.out.println("שכר כולל בונוס: " + total);
  26.  
  27.         in.close();
  28.     }
  29.  
  30. }
  31.  
Add Comment
Please, Sign In to add comment