All pastes #495363 Raw Edit

Tikoriko

public javascript v1 · immutable
·published 2007-05-18 18:41 UTC
rendered paste body
(iii) An imaginary internet clothing store operates the following deliverycharges.• For orders worth less than £25 the delivery charge is £3.00.• Orders worth at least £25 but less than £100 are delivered free.• Orders worth £100 or more are delivered free and in addition thecustomer receives a free gift.We have started writing a JavaScript program that prompts a user toenter the value of their order, then tells them which of the categoriesabove will apply.// A delivery charge programvar orderValue; // How much the order is worthorderValue = window.prompt('How much is the order worth inPounds Sterling?','');document.write('The value of your order is £' + orderValue+ '.<BR>');// Insert your code heredocument.write('<BR>');document.write('Thank you for shopping with us.');Figure 7 An incomplete JavaScript program(a) Using program_7.3.9 as a guide, complete the code above so thatit will work out which band the order falls in, then display asuitable message on the screen using the document.write()method. Please note the following points.1 You will need to add appropriate HTML tags before and afterthe code, as well as completing the JavaScript whereindicated. program_7.3.9 will show you what HTML tags touse. You should give the window the title 'Delivery charges'.2 There is no need for your program to check that the user'sinput is actually a valid number; you may assume that this willalways be the case.3 You should use indentation to help make the structure of yourprogram clear, in the same way program_7.3.9 does.page 12 of 124 A copy of the incomplete program as shown above in Figure 7can be found in the file Q4(iii).html that you downloadedwith this assignment.Insert a copy of your completed program into the documentcontaining your solution. [8](b) Run your program with each of the following inputs. (Note thatyou only need to enter the figures, without any £ sign.)• 24• 25• 99• 100For each run insert a screen shot of the browser window into thedocument containing your solution.