Question: In Javascript modify the attached file to implement the function calculateTotalPrice as per requirements: / * * The price per ticket depends on the number

In Javascript modify the attached file to implement the function calculateTotalPrice as per requirements: /*
* The price per ticket depends on the number of tickets
* purchased, there are 4 ticket pricing tiers. Given the
* number of tickets return the total price, formatted to
* exactly two decimal places with a leading dollar sign.
* Tier 1:
* Minimum number of tickets: 1
* Price per ticket: $16.75
* Tier 2:
* Minimum number of tickets: 4
* Price per ticket: $14.00
* Tier 3:
* Minimum number of tickets: 7
* Price per ticket: $11.00
* Tier 4:
* Minimum number of tickets: 11
* Price per ticket: $8.50
*/
function calculateTotalPrice(numberOfTickets){
//YOUR CODE STARTS HERE
//YOUR CODE ENDS HERE
}
// $33.50
console.log(calculateTotalPrice(2));
// $56.00
console.log(calculateTotalPrice(4));
// $99.00
console.log(calculateTotalPrice(9));
// $110.50
console.log(calculateTotalPrice(13));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!