Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROBLEM DESCRIPTION You are required to create a webpage to implement a program for the World Travel company based on the logic designed on the

image text in transcribedimage text in transcribed

PROBLEM DESCRIPTION You are required to create a webpage to implement a program for the World Travel company based on the logic designed on the previous flowchart and pseudocode. The webpage will include JavaScript code in order to calculate the final price. You will also follow a precise sequence of inputs and outputs in your program As a reminder, the pricing list is listed below: Destination: Europe Air Travel: One Way: $500 Round Trip: $900 Hotel: $300 per night Tour Grand package: $1,500 Basic package: $800 Africa Air Travel: One Way: $700 Round Trip: $1,300 Hotel: $200 per night Grand package: $1,300 Basic package::$500 Inputs: Continent: Europe or Africa. Air Travel: One Way or Round Trip. Hotel: Number of nights. Tour: Grand or Basic Outputs: Final price Note: add 15% to the total price to calculate the final price Follow the sequence of input/output steps below: 1. Prompt to get the Destination (E=Europe, A=Africa). 2. Prompt to get Air Travel option (O=One Way, R=Round Trip). 3. Prompt to get the number of Hotel nights 4. Prompt to get the Tour type (G-Grand, B-Basic) 5. Alert to display the Final Price. Tour: SAMPLE TRACES THROUGH THE CORRECT ALGORITHM Sample 1 Sample 2 Inputs: Destination Air Travel Hotel nights Tour Output: Final Price Europe One Way 7 Grand Africa Round Trip 5 Basic $4715 $3220 . Additional Information: Be sure to include a comment with your name and section in the part of your HTML code program. 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 Number() to ensure that the numeric input is treated as numeric data. Syntax example: numericVariable = Number(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/sref 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); Syntax example for displaying a number with a precision of 2 decimals: alert("The number is " + someNumber.toFixed(2)); You will use several variables in this program. It is good practice to store the 15% surcharge (expressed as 0.15). This way it may be used in the calculation of the final price

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions

Question

Which of the following holds true for evidence-based management

Answered: 1 week ago

Question

Prepare an ID card of the continent Antarctica?

Answered: 1 week ago