Marvel

 avatar
user_9363972
javascript
a month ago
387 B
7
Indexable
Never
const price = 5;
var quit = false;
var totalPrice = 0;
let person = prompt("Please enter your name : ");
while (!quit) {
  let order = prompt("Input Order : ");
  totalPrice += order * price;
  let question = prompt("do you want to add order (yes/no) ? ");
  question === "yes" ? (quit = false) : (quit = true);
}

console.log("Total for Mr/Ms.", person, " : ", totalPrice);
Leave a Comment