Advertisement
Spocoman

05. Supplies for School

Aug 31st, 2023 (edited)
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int penCount, markerCount, detergentCount;
  7.     cin >> penCount >> markerCount >> detergentCount;
  8.  
  9.     double discount;
  10.     cin >> discount;
  11.  
  12.     double penPrice = penCount * 5.80;
  13.     double markerPrice = markerCount * 7.20;
  14.     double detergentPrice = detergentCount * 1.20;
  15.  
  16.     double totalPrice = (1 - discount / 100) * (penPrice + markerPrice + detergentPrice);
  17.  
  18.     cout << totalPrice << endl;
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement