Question: Need to be programmed in html/javascript 1. Calculate the gas mileage of a vehicle. Ask for the starting and ending odometer readings (in miles) and

Need to be programmed in html/javascript

1. Calculate the gas mileage of a vehicle. Ask for the starting and ending odometer readings (in miles) and the gasoline needed to fill the tank (in gallons). Use these data to calculate the mileage (in miles per gallon) and display the all of the input values and the answer. Ask the user if he wants to enter another odometer reading, and if so, ask for an ending odometer reading (use the previous calculation's ending reading as the starting reading for this one). Continue until the user wants to stop.

2. Calculate the cost of a meal. The restaurant takes 10% off the bill if it's the birthday of anyone in the party. Ask the user if a tip should be included. If so, ask the user if the tip is a fixed amount or based on a percentage. Obtain the appropriate value and use it to calculate the tip amount. Display all the values on the page, including the total cost of the meal with tip included. initial meal cost has to be a user input.

3. Create a page that converts a range of temperatures from Celsius to Fahrenheit. Ask for the starting and ending temperatures (you'll have to ask the user if the temperatures are F or C) along with the increment to be used. Make sure all of the data are valid, i.e. the ending temperature is greater than the starting temperature and the increment is a positive value that is sensible. If the user enters anything invalid, tell the user what the problem is and ask again until it is entered properly. Once all the data is valid, generate a table that shows each temperature value across the range in both degrees F and degrees C. Each set of temperatures should take one row in the table. The length of the table will depend on the number of values the user chooses to display.

4. Build a script to determine the cost of a movie ticket. Movies that begin prior to noon on a weekday cost $10 for adults (18 or older) and $5 for children (under 18). Otherwise, tickets are $15 each for adults and $12 for children. If a movie is rated "R", the customer cannot purchase the ticket if not an adult. Finally, senior citizens (over 65) get a 10% discount. Show all the details along with the ticket price after all data has been entered. Invalid data must be repeatedly asked until valid.

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!