# discussion question 1330

JavaScript can add another dimension to our sites with simple math calculations, such as working with conditionals for an order form to add the proper taxes or currency conversions. Letâ€s return to QVR Tours for this thread and write someJavaScript that will assist in the following calculations:

• Add a concierge fee of \$150 to tours that cost more than \$2,500 and a fee of \$300 if a tour costs more than \$3,500
• Concatenate a travelerâ€s first and last name

Discounts a tour if there are more than 8 people attending (you decide on the discount)

Can be very basic

examples

const discount=150;

var totalCost = 0;

const tourCost= 2500;

const tourCost2=3500;

const conciergeFee1=150;

const conciergeFee2=300;;

const ticketAfterDiscount =0;

var firstName = prompt (â€œEnter first nameâ€);
var lastName= prompt (â€œEnter Last nameâ€);

var tourPrice = (â€œEnter the amount of the ticketâ€);

if (tourPrice < tourCost && tourPrice < tourCost2);

{

tourPrice = totalCost;

cosole.log(â€œTotal Cost = \$â€ tourPrice);

}

else if (tourPrice > tourCost && tourPrice < tourCost2);

{

tourPrice = totalCost + conciergeFee1;

cosole.log(â€œTotal Cost = \$â€ tourPrice);

}

else if (tourPrice > tourCost && tourPrice > tourCost2);

{

tourPrice = totalCost + conciergeFee2;

cosole.log(â€œTotal Cost = \$â€ tourPrice);

}

else

{

cosole.log(â€œInvalid Entryâ€);

}

var personsInGroup = (â€œEnter number of people in groupâ€);

if (personsInGroup > 8)

{

ticketAfterDiscount = totalCost + discount;

cosole.log(â€œTotal Cost = \$â€ ticketAfterDiscount);

}

else

{

ticketAfterDiscount = totalCost;

cosole.log(â€œPrice after discount = \$â€ ticketAfterDiscount);

}

Var nameOfGuest = firstName+ lastName;
console.log(â€œ Thank youâ€ nameOfGuest â€œyour total cost is \$â€ ticketAfterDiscount);