Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function catShirt(input) {
- let sleeveSize = Number(input.shift());
- let frontSize = Number(input.shift());
- let fabricTypes = input.shift();
- let tieOrNot = input.shift();
- let sum = (sleeveSize * 2 + frontSize * 2) * 1.1 / 100;
- if (fabricTypes === "Linen") {
- sum *= 15;
- } else if (fabricTypes === "Cotton") {
- sum *= 12;
- } else if (fabricTypes === "Denim") {
- sum *= 20;
- } else if (fabricTypes === "Twill") {
- sum *= 16;
- } else if (fabricTypes === "Flannel") {
- sum *= 11;
- }
- sum += 10;
- if (tieOrNot === "Yes") {
- sum *= 1.2;
- }
- console.log(`The price of the shirt is: ${sum.toFixed(2)}lv.`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement