Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED answer to FR1.2 Code Below: // TODO Offer a taxi for the given OUCU function offer(oucu, address, startTime, endTime) { // TODO 2(a) FR1.1

image text in transcribed

NEED answer to FR1.2

Code Below:

// TODO Offer a taxi for the given OUCU function offer(oucu, address, startTime, endTime) { // TODO 2(a) FR1.1 // You need to implement this function // See the TMA for an explanation of the functional requirements var formData = new FormData(); formData.append("oucu", oucu); formData.append("type", "0"); formData.append("address", address); formData.append("start", startTime); formData.append("end", endTime);

var url = BASE_URL + "orders"; var xhr = new XMLHttpRequest();

xhr.onload = function () { var obj = JSON.parse(xhr.responseText); console.log("offer: received obj", obj);

if (obj.status == "success") { alert("User " + oucu + " has made a successful offer")

} else if (obj.message) { alert(obj.message); } else { alert(obj.status + " " + obj.data[0].reason); } }

xhr.open("POST", url, true); xhr.send(formData); console.log("offer: sending post to " + url); }

// TODO Request an offered taxi for the given OUCU function request(oucu, address, startTime) { // TODO 2(a) FR1.2 // You need to implement this function // See the TMA for an explanation of the functional requirements }

The functional requirements (FR) for this app are described as follows. FR1. The app shall offer, request and cancel taxi-sharing for an employee with a valid OUCU. This functional requirement is further refined as follows: FR1.1 Offering a taxi for a duration of availability with a pick-up address (the campus or train station), starting date, time and duration in hours) for which the offering user is prepared to wait (using the taxi/orders API) FR1.2 Requesting a taxi at a pick-up address for a specific date and time using the taxi/orders API FR1.3 Cancelling all taxi orders by deleting all existing orders offers and requests) associated with an OUCU (using the taxi/orders API). . The functional requirements (FR) for this app are described as follows. FR1. The app shall offer, request and cancel taxi-sharing for an employee with a valid OUCU. This functional requirement is further refined as follows: FR1.1 Offering a taxi for a duration of availability with a pick-up address (the campus or train station), starting date, time and duration in hours) for which the offering user is prepared to wait (using the taxi/orders API) FR1.2 Requesting a taxi at a pick-up address for a specific date and time using the taxi/orders API FR1.3 Cancelling all taxi orders by deleting all existing orders offers and requests) associated with an OUCU (using the taxi/orders API)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Observation And Audit Techniques For Measuring Retail Sales

Authors: Earl E. Houseman

1st Edition

0428139841, 978-0428139841

More Books

Students also viewed these Accounting questions