Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <script>
- var cost;
- var costNumber = 0;
- var cash;
- var cashNumber = 0;
- var cashBack;
- var costText = ("Cost of merchandise");
- var cashText = ("Cash Paid");
- function costPrompt() {
- dataPrompt(cost, costText, costNumber, costPrompt);
- }
- function cashPrompt() {
- dataPrompt(cash, cashText, cashNumber, cashPrompt);
- }
- function dataPrompt(x, y, z, a) {
- x = prompt (y);
- z = parseFloat(x);
- if (isNaN(z)) {
- alert ("That's not a number, cumface. Try again.");
- a();
- }
- }
- costPrompt();
- cashPrompt();
- console.log ("cashNumber " + cashNumber);
- console.log ("costNumber " + costNumber);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement