Professional Documents
Culture Documents
ITR Railway is a new railway service. Currently, they have an application that facilitates ticket booking. ITR
Railway Management gets numerous cancellations as well. Processing ticket cancellation manually takes an
enormous amount of time. So, they decide to automate the process. When customers want to cancel their tickets,
they can do it until it’s 2 days before the travel date. Help them to develop a web page to calculate the total
refund amount along with the convenience fee and cancellation charges. On submitting the details of the booked
travel, the message on cancellation has to be displayed on the same page as shown in the given screenshots.
After entering valid details and clicking on the CONFIRM CANCELLATION button
Use the Label Name and the Component Id as given. All the necessary attributes for the Components
should be given. If the Component Id is not provided for an HTML component, marks will not be
provided for that component. All Tags, Elements and Attributes should conform to HTML5 Standards.
All the fields are mandatory.
Use type=“text”
Note: Fill in the style tag so as to have the given styles applied to the
components. (Do not use Inline CSS)
3 Use JavaScript Use JavaScript for displaying the refund amount details:
for displaying
the refund When the valid values are entered and the submit button is clicked, the
amount details. refund amount should be displayed as follows:
“Hi passengerName, your ticket has been successfully canceled and the
refund amount is Rs. refundAmount ”
in a div tag with id as “result”.
Formula:
ConvenienceFee = noOfTickets * convenience fee per ticket
CancellationCharge = amountPaid * cancellation percentage
RefundAmount = amountPaid - convenienceFee – cancellationCharge
Note:
Use the getElementById() function to retrieve the values.
Use Math.round() on RefundAmount to get its rounded value.
In Javascript, Please do not use “let” or “const”. Instead, use “var”.
4 form Tag with form Tag is already given in the code template. Do not change the code
attribute template and do the coding as per the requirements and specification.
onsubmit
Make sure that the onsubmit attribute in the form tag invokes the
JavaScript function like "return display()".Also ensure that the “return
false;” statement should be the last line of the JavaScript function
“display()”.