Advertisement
Spocoman

Cat Shirt

Sep 16th, 2023 (edited)
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double sleeveSize, frontSize;
  8.     cin >> sleeveSize >> frontSize;
  9.  
  10.     string fabricTypes, tieOrNot;
  11.     cin >> fabricTypes >> tieOrNot;
  12.  
  13.     double sum = (sleeveSize * 2 + frontSize * 2) * 1.1 / 100;
  14.  
  15.     if (fabricTypes == "Linen") {
  16.         sum *= 15;
  17.     }
  18.     else if (fabricTypes == "Cotton") {
  19.         sum *= 12;
  20.     }
  21.     else if (fabricTypes == "Denim") {
  22.         sum *= 20;
  23.     }
  24.     else if (fabricTypes == "Twill") {
  25.         sum *= 16;
  26.     }
  27.     else if (fabricTypes == "Flannel") {
  28.         sum *= 11;
  29.     }
  30.  
  31.     sum += 10;
  32.  
  33.     if (tieOrNot == "Yes") {
  34.         sum *= 1.2;
  35.     }
  36.  
  37.     printf("The price of the shirt is: %.2flv.\n", sum);
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement