Advertisement
veronikaaa86

05. Supplies for School

Jan 9th, 2022
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P05SuppliesForSchool {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int pensCount = Integer.parseInt(scanner.nextLine());
  8. int markersCount = Integer.parseInt(scanner.nextLine());
  9. int litersDetergent = Integer.parseInt(scanner.nextLine());
  10. int percent = Integer.parseInt(scanner.nextLine());
  11.  
  12. double sumPens = pensCount * 5.80;
  13. double sumMarkers = markersCount * 7.20;
  14. double sumDetergent = litersDetergent * 1.20;
  15.  
  16. double allSuppliesSum = sumPens + sumMarkers + sumDetergent;
  17.  
  18. double sumWithDiscount = allSuppliesSum - (allSuppliesSum * (percent / 100.0));
  19.  
  20. System.out.println(sumWithDiscount);
  21. }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement