Advertisement
mmayoub

Ex05, 17.04.2021

Apr 20th, 2021
1,264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. // 17.04.2021
  2. import java.util.Scanner;
  3.  
  4. public class Ex05 {
  5.  
  6.     public static void main(String[] args) {
  7.         // TODO Auto-generated method stub
  8.         Scanner in = new Scanner(System.in);
  9.  
  10.         double price;
  11.         double cash;
  12.         double ins;
  13.         double kast;
  14.  
  15.         // get data from user
  16.         System.out.print("enter the total price: ");
  17.         price = in.nextDouble();
  18.  
  19.         // process data
  20.         cash = price * 20.0 / 100;
  21.         ins = price * 80.0 / 100;
  22.         kast = ins / 5.0;
  23.  
  24.         // print results
  25.         System.out.println("cash = " + cash);
  26.         System.out.println("Total for aksat = " + ins);
  27.         System.out.println("kast = " + kast);
  28.  
  29.         in.close();
  30.     }
  31.  
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement