Advertisement
yovkovbpfps

Simple Operations School Supplies

Apr 20th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Schoolstaff {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double pencilPrice = 5.80;
  8. double markerPrice = 7.20;
  9. double litre = 1.20;
  10.  
  11. int pencilPackages = Integer.parseInt(scanner.nextLine());
  12. int markerPackages = Integer.parseInt(scanner.nextLine());
  13. double litreClean = Double.parseDouble(scanner.nextLine());
  14. int discount = Integer.parseInt(scanner.nextLine());
  15.  
  16. double pencilPr = pencilPrice * pencilPackages;
  17. double markerM = markerPackages * markerPrice;
  18. double clean = litre * litreClean;
  19.  
  20. double allPrice = (pencilPr + markerM + clean);
  21. double discount1 = allPrice - ((allPrice * discount) / 100);
  22.  
  23. System.out.printf("%.3f",discount1);
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement