Question

assuming a store has an equipments rental service. You are commissioned to create a html new...

assuming a store has an equipments rental service. You are commissioned to create a html new page to allow the choice of an equipment from a short list and then allow selections of rental starting date and ending date and then calculate the number of days between the 2 selected dates.    Finally, multiply the unit rental cost with the number of days and add 8% tax for the total cost. ( Must use Javascript ) Cost can be any, rental equipment can be any.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is code:

<html>

<script>

function generate() {

eqpt = document.getElementById("eqptList")

sDate = document.getElementById("startDate")

eDate = document.getElementById("endDate")

var date1 = new Date(sDate.value);

var date2 = new Date(eDate.value);

if (date1 == "Invalid Date" || date2 == "Invalid Date") {

alert("Invalid date entered");

} else {

// calculating number of days differ

var diffDays = parseInt((date2 - date1) / (1000 * 60 * 60 * 24));

if (diffDays < 0) {

alert("End date should be greater then start date");

} else {

var eqptCost = Number(eqpt.value); // Equipment cost

var cost = eqptCost * diffDays; // Equipment cost * day differ

var tax = cost * (8 / 100); // calculating tax

var total = cost + tax; // total sum

alert(total);

}

}

}

</script>

<body>

<div id="demo">

<table>

<tbody>

<tr>

<td>

Equipment

</td>

<td>

<select id="eqptList">

<option value="123">Mobile</option>

<option value="568">Switch</option>

<option value="800">PC</option>

</select>

</td>

</tr>

<tr>

<td>

Start Date :

</td>

<td>

<input type="text" id="startDate" placeholder="YYYY-MM-DD">

</td>

</tr>

<tr>

<td>

End Date :

</td>

<td>

<input type="text" id="endDate" placeholder="YYYY-MM-DD">

</td>

</tr>

<tr>

<td>

</td>

<td>

<button onclick="generate()">Submit</button>

</td>

</tr>

</tbody>

</table>

</div>

</body>

</html>

Output:

Equipment Mobile v Start Date 2018-02-01 End Date 2018-02-05 531.36 OK Submit

Add a comment
Know the answer?
Add Answer to:
assuming a store has an equipments rental service. You are commissioned to create a html new...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Could you create a website based on html and css? Details in the below: Note: You...

    Could you create a website based on html and css? Details in the below: Note: You can put link that I can download that folder Based on Project 2-1, do the necessary changes to have a webpage structure of a header, main, and footer sections. Then: •Set the width of the page to 700px •Use the font family starting with Verdana •Move one of the images from your Project 2-1 to the header. •Set the width of the header image...

  • The purpose is to serve as a bridge between your existing knowledge of HTML/JS and the...

    The purpose is to serve as a bridge between your existing knowledge of HTML/JS and the server side programming. You are required to use Node.js, Express and EJS for this assignment.. Tasks: In this assignment, you are to develop a web application for an online store. The type of store that you design, and its inventory is left to your discretion. 1. HTML Static Content - Web Form • The front end must collect all the information needed to mail...

  • Create a webpage (the last picture has three potential offers not just 2). Use html, JavaScript...

    Create a webpage (the last picture has three potential offers not just 2). Use html, JavaScript and CSS where needed. All information needed is supplied by the picture. Summary Create a dynamic web page that allows users to compare different financing offers for an automobile loan. Purchasers are often presented with different financing offers, and determining the best offer can be difficult. In particular, dealers often have promotions that offer either a lower interest rate or a cash incentive (sometimes...

  • In this assignment you will combine HTML, PHP, and SQL in order to create a web...

    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...

  • given below are the project description and their Html and css files i need javascript according to the project and other files!

    HTML------------------------------------------------------CSS---------------------------------------------------WEB230 - JavaScript 1 Assignment 7 - FormsSome of these tasks would be better done in HTML or CSS but do them in JavaScript to practice whatwe have learned.1. Select the form element and save it in a variable. From here we can access all of the form fields.2. When the page loads do the following:add the password value "monkey"select the favourite city "New York"clear the textarea3. Add an event handler to the "name" field to change the background color...

  • Create an HTML5 page that contains a form to collect the following data. The text in...

    Create an HTML5 page that contains a form to collect the following data. The text in bold indicates the id value that should be assigned to each html control: Product (drop down list) product – iPad, iPhone 6S, Galaxy 5S, Moto X, and so on Quantity (number) quantity Unit price (number) unit_price Discount (%)(number) discount_rate Date (date)   order_date First Name (text box)   first_name Last Name (text box)   last_name Payment type (drop down list)   payment_type – Visa, Master, Discover, Amex, and...

  • You are starting a new business of Shoes to be sold through internet and specialized stores You c...

    You are starting a new business of Shoes to be sold through internet and specialized stores You can produce 3 per day. You'll work 18 days a month You have a potential customer- which will buy a minimum quantity of 60, they have promised sales of 300 per year, they pay at 60 days You expect to sell 20 per month by internet as of March You need 0.5 square meters of leather & 0.5 kgs of rubber Your rubber...

  • Create a program using C++ for a store. It will be a ledger for daily transactions....

    Create a program using C++ for a store. It will be a ledger for daily transactions. It should be able to record the transactions on a date. The transactions will happen at a given time (hour, minute, second). Also, every transaction must have a unique ID that is a number that is randomly generated by the system. *Note that the transaction has an ID, NOT the items. There will be no more than 10 transactions on a date. Within every...

  • New Perspectives on HTML5 and CSS3. Solve Chapter 13 Case Problem 3. mas_register.js "use strict"; /*...

    New Perspectives on HTML5 and CSS3. Solve Chapter 13 Case Problem 3. mas_register.js "use strict"; /* New Perspectives on HTML5, CSS3, and JavaScript 6th Edition Tutorial 13 Case Problem 3 Filename: mas_register.js Author: Date: Function List ============= formTest() Performs a validation test on the selection of the conference session package and the conference discount number calcCart() Calculates the cost of the registration and saves data in session storage    writeSessionValues() Writes data values from session storage in to the registration...

  • HTML / CSS Content Requirements Create a home page with the following elements and settings: Set...

    HTML / CSS Content Requirements Create a home page with the following elements and settings: Set the background, font colors, and “theme” to match those used in lab assignment #1 using an external css file; inline styling should be used only where necessary to override styling from the external css H1 element, centered at the top of the page, with “Thank you for choosing Your Company Name. . . “ text* Div or other container with at least 5 sentences...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT