Advertisement
IvanITD

05.SuppliesForSchool

Jan 14th, 2024 (edited)
591
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | Source Code | 0 0
  1. int penPacketAmount = int.Parse(Console.ReadLine());
  2. int markerPacketAmount  = int.Parse(Console.ReadLine());
  3. int cleaningDetergentAmount = int.Parse(Console.ReadLine());
  4. int discountPercent = int.Parse(Console.ReadLine());
  5.  
  6.  
  7. double penPacketPrice = penPacketAmount * 5.80;
  8. double markerPacketPrice = markerPacketAmount * 7.20;
  9. double cleaningDetergentPricePerLiter = cleaningDetergentAmount * 1.20;
  10.  
  11. double totalPrice = penPacketPrice + markerPacketPrice + cleaningDetergentPricePerLiter;
  12.  
  13. double discount = (double)discountPercent / 100;
  14.  
  15. double result = totalPrice - (totalPrice * discount);
  16.  
  17. Console.WriteLine(result);
Tags: C#
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement