Using HTML 5 and Javascript, build a web page that allows customers to book rental cars. Customers pick a car type (Compact, Intermediate, Standard) using a drop down list, enter the number of days using a text box and select if they want to buy Insurance or not using radio buttons. Compact cars cost $30 / day, Intermediate cars cost $40 / day and Standard cars cost $50 / day. Insurance costs $15 / day for all car types. Your web page should compute and display the total cost of renting the car.
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Here a new web page with name "bookRentalCars.html" is created, which contains following code.
bookRentalCars.html :
<!DOCTYPE html>
<html lang="en">
<head>
<!-- title for web page -->
<title>Book Rental Cars</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <script> is used for javascript -->
<script>
//function to calculate total cost
function CalculateCost() {
//getting car type
var carType = document.getElementById("carType").value;
//getting number of days
var days = document.getElementById("txtDays").value;
//getting radio button
var insurance = document.getElementsByName("insurance");
//checking values
if (carType == "Select Car") {
alert("Select Car Type");//alert user
}
else if (days == " " || days == 0) {
//if no days are entered or 0 days entered
alert("Enter atleast 1 day");
}
else {
var totalCost = 0;//variablt to store total cost
if (insurance[0].checked) { //when insurance is taken
totalCost = carType * days + 15 * days;//calculate total cost
}
else {
//when no insurance is taken
totalCost = carType * days;//calculate total cost
}
//display total cost
document.getElementById("rentCar").innerHTML = "Total Cost of renting the car is : " + totalCost;
}
}
</script>
</head>
<body>
<h1>Book Rental Cars</h1>
<form action="">
Select car type :
<!-- drop down list -->
<select id="carType">
<option value="Select Car" selected>--Select Car--</option>
<option value="30">Compact</option>
<option value="40">Intermediate</option>
<option value="50">Standard</option>
</select>
<br><br>
Number of days :
<!-- textbox -->
<input type="text" id="txtDays" />
<br><br>
Insurance :
<!-- radio buttons -->
<input type="radio" name="insurance">Yes
<input type="radio" name="insurance">no
<br><br>
<input type="button" value="Total Cost" onclick="CalculateCost()" />
<br><br>
<!-- div to dispaly tota; cost of rent -->
<div id="rentCar"></div>
</form>
</body>
</html>
======================================================
Output : Open web page bookRentalCars.html in the browser and will get the screen as shown below.
Screen 1 :bookRentalCars.html

Screen 2:Screen when Car type is not selected

Screen 3:Screen when number of days is not entered

Screen 4:Screen showing totalCost when insurance is not taken

Screen 5:Screen showing totalCost when insurance is taken

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
Using HTML 5 and Javascript, build a web page that allows customers to book rental cars....
Description: The car rental company allows customers to reserve rental cars over the internet, the company also allows customers to rent cars by calling up car rental personnel or by walking up to the rental counter. The rental car company has a number of branches and each car is assigned to a home branch. Cars are always rented from the home branch but may be returned to a different branch. Cars are sometimes shifted from location to location – i.e....
JAVASCRIPT Create a simple web page that contains a JavaScript form that will allow the user to answer 7 trivia questions. Your trivia game should contain: 2 text boxes 2 select dropdowns 2 multiple choice questions (using radio buttons, 4 options min) 1 choose-all-that-apply (checkboxes, 4 options min, one answer should be "None of the above"). No part-points for semi-correct answers. The questions can cover any topic you wish - but please keep it professional and easy enough that the...
In this assignment you will combine HTML, PHP, and SQL in order to create a web form that allows a manager to add films to the sakila database. You will also create a method to allow the manager to view a list of all films along with their related information, and a list of actors in the movies. Task 1 Create an initial HTML page titled manager.html with 2 buttons. The first button will be labeled “View Films”, and the...
Develop an HTML form that could be used to enter your book information (Books, Authors, and Publishers) start with the HTML/JavaScript template provided Expand upon it! What field information would you enter into a system? Have your form use more then just character text fields ... radio buttons, pick lists, and other elements make your form easier to use and you don't need to do lots of JavaScript checks. What fields would be mandatory ... which could be left blank?...
Design an original, professional web site following the specifications listed below. This web site will be for a business you plan to set up for yourself or for someone else. The following is a detailed list of the requirements for your web site. READ them carefully. Instructions - Web Site Requirements for the web site: General: You will thoroughly test all your pages in more than one browser. All links MUST work. All graphics must show on the page. All...
Form Processing HTML
One of the most ubiquitous uses of JavaScript is validating form
data on the client side before it is submitted to the server. It is
done everywhere because it is fast and it gives you a great deal of
flexibility in how you handle errors insofar as the GUI is
concerned.
Attached is an image of some code I wrote (so Blackboard can't
mess it up). Some things to notice that will help you with the
lab....
I need help writting a Javascript function that does the
following its for a HTML/CSS Shopping Cart Page
CODE
This page contains a list of the selected products that includes an image, name, price, quantity, and cost) Because the process is implemented not as real, three products along with its image and price are displayed on the page. The product ID of each product is stored in a hidden textbox. The default amount of each product is 1 and the...
Zipcar: “It’s Not About Cars—It’s About Urban Life” Imagine a world in which no one owns a car. Cars would still exist, but rather than owning cars, people would just share them. Sounds crazy, right? But Scott Griffith, CEO of Zipcar, the world’s largest car-share company, paints a picture of just such an imaginary world. And he has nearly 800,000 passionate customers—or Zipsters, as they are called—who will back him up. Zipcar specializes in renting out cars by the hour...
JAVA Hello I am trying to add a menu to my Java code if someone can help me I would really appreacite it thank you. I found a java menu code but I dont know how to incorporate it to my code this is the java menu code that i found. import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ButtonGroup; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JRadioButtonMenuItem; public class MenuExp extends JFrame { public MenuExp() { setTitle("Menu Example");...
Read the case study "Google, Apple, and Facebook Struggle for
Your Internet Experience" on page 255. Then discuss the advantages
and disadvantages for each company.
BUSINESS PROBLEM-SOLVING CASE Google, Apple, and Facebook Battle for Your Internet Experience Apple has a legacy of innovation on its side. In Three Internet titans Google, Apple, and 2011, it unveiled the potentially market disrupting Facebook are in an epic struggle to dominate your Siri (Speech Interpretation and Recognition Internet experience, and caught in the...