Guest User

PB - Supplies for School

a guest
Apr 20th, 2020
39
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(arg1, arg2, arg3, arg4) {
  2.     pen = Number(arg1);
  3.     mar = Number(arg2);
  4.     prep = Number(arg3);
  5.     discount = Number(arg4);
  6.  
  7.     let penPrice = (arg1 * 5.80);
  8.     let marPrice = (arg2 * 7.20);
  9.     let prepPrice = (arg3 * 1.20);
  10.     let totalPrice = penPrice + marPrice + prepPrice;
  11.     let discountPercent = arg4 / 100;
  12.     let discountPrice = totalPrice * discountPercent;
  13.     let finalPrice = totalPrice - discountPrice;
  14.     console.log(finalPrice.toFixed(3));
  15. }
  16.  
  17. solve(7, 8, 0.5, 45)
RAW Paste Data