Question
Create a function declaration called formatMoney() that takes two parameters. The first parameter should be the dollar amount to format. The second parameter will be
Create a function declaration called formatMoney() that takes two parameters. The first parameter should be the dollar amount to format. The second parameter will be a boolean value whereby, if true, would see the dollar amount formatted with commas (,) separating the thousands - like $2,344.33. If the flag is false, do not include the commas in the formatted values. The programmer (you) will set the boolean flag, not the user.
Use a prompt() to gather the initial dollar amount from the user and then pass that value into your calcTax function. Take the return of that function and pass it to your formatMoney() function. The returned, properly taxed, properly formatted value, should appear in an alert() box. Save all of this work in a js file called taxMoney.js. Please attach it to a properly formatted HTML page called taxIt.html.
Code for all above is commented - header and inline - functions are well commented.
Code for all above is properly aligned and nested, braces are aligned. Variables and page names are named appropriately and lowerCamelCasing is observed.
JAVASCRIPT.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started