Advertisement
Spocoman

Christmas Preparation

Sep 16th, 2023
920
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double paper, cloth, glue, discount;
  8.     cin >> paper >> cloth >> glue >> discount;
  9.  
  10.     double paperPrice = paper * 5.80, clothPrice = cloth * 7.20, gluePrice = glue * 1.20;
  11.  
  12.     printf("%.3f\n", (paperPrice + clothPrice + gluePrice) * (1.0 - discount / 100));
  13.  
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement