The company that needed the flowchart and pseudocode for calculating a final price for has given you the responsibility of creating a program for that purpose.
The requirements remain the same as those indicated for the flowchart: the program will calculate the final price that a customer will pay for a product based on an initial price, membership on the Store Club and customer's state of residence. The company serves customers in New York and New Jersey. The components of the final price are the initial price, discount, shipping charge and tax.
The discount - 10% of the initial price - is given only to the members of the Store Club. The shipping charge is $5 for New Jersey customers and $3 for New York customers. The tax - applied to the sum of the discounted price plus shipping charge is 8% for New York customers and 7% for New Jersey customers. The output of the program will be the final price.
The company has also provided a video - attached to these instructions on Sakai that displays the way the program should work as well as the screen format when the program is run. (Note: on the video the program is run twice with two different data sets).
Since the content of a text box - which is what the prompt() function generates - is going to be used in mathematical operations, use the function parseInt() to ensure that the numeric input is treated as numeric data.
Syntax example:
numericVariable = parseInt(numericVariable)
To simplify the comparison of text data entered by the user, it is often easier to convert this text to upper case using the notation below.
Syntax example:
textVariable = textVariable.toUpperCase();
(See https://www.w3schools.com/jsref/jsref_toUpperCase.asp for additional example.)
Syntax example for prompt function:
var myName = prompt("Enter your name");
Syntax example for alert function:
alert("My name is + myName);