some text

Cs701 module2 assignment

CS701 Module2 Assignment

General Rules for Homework Assignments

• You are strongly encouraged to add comments throughout the program. Doing

so will help your facilitator to understand your programming logic and grade you

more accurately.

• You must work on your assignments individually. You are not allowed to copy the

answers from the others. However, you are encouraged to discuss approaches

to the homework assignment with your facilitator.

• Each assignment has a strict deadline. However, you are still allowed to submit

your assignment within 2 days after the deadline with a penalty. 15% of the credit

will be deducted unless you made previous arrangements with your facilitator

and professor. Assignments submitted 2 days after the deadline will not be


• When the term lastName is referenced in an assignment, please replace it with

your last name.

You are strongly encouraged to add comments into your program!

Create a new folder named HW2_lastName. Write the following programs in this folder.


You decided to release the dove residing in your birdcage. But, you are keen in tracking

the flight of the bird. So, you tied a sensor tag to the poor bird and decided to write a

HTML5 application to monitor its path. Since you neither have the bird nor the sensor,

you decided to simulate the path.

Part 1 – Geolocation (30 Points)

Using the HTML5 Geolocation API, write the LocationTracker.html and the associated

Javascript file LocationTracker.js. You are free to use the html5.css from the samples.

The initial rendering of the HTML page is shown below with placeholders for the location

details and the Google map.

When the Start button is clicked, get the current position using the Geolocaiton API and

display the initial location in the map as shown below. After the initial location is

displayed, use the setInterval method to invoke your method updateMyLocation every 5

seconds. The Start button is disabled from now on.

The updateMyLocation method simulates the changes in the latitude and longitude as

follows. Generate two random numbers using Math.random() and divide each by 100.

These two numbers represent the changes in the latitude and longitude. Modify the

current location by adding the latitude value and subtracting the longitude value. This will

make the bird only fly in the NorthWest direction. If you are on the Northern border or the

Western border, feel free to keep the bird over the United States (or your country) by the

appropriate changes to the current location. Update the current location in the HTML and

also draw the path in the Google Map as shown in the following screencast:

Part2 – HTML5 Drag and Drop and Local Storage (40 points)

Democrat and Republican senators voting by their party lines through Drag and


The application presents a list of senators and two areas representing Democrats and

Republicans. The senators are dragged and dropped into their respective areas.

The initial list is loaded through AJAX from the partyList.xml file (provided in the

samples). Each senator is converted to a JSON object keeping track of the properties

name,  party, and voted (true or false). The list of senators is then stored in local storage.

Whenever a senator is dragged and dropped into their respective area, the JSON object is

updated as voted and the list of senators is updated in the local storage. When the

application is loaded, the local storage is first checked. If the data is there, the list of

senators is loaded from the local storage, otherwise the AJAX call is made.

When the data exists in the local storage and the application is loaded, the senators

already dragged into their respective areas should also be populated. Make sure you test

this case.

Write the partyWise.html and partyWise.js for the application’s functionality.

The structure of partyList.xml is shown below.

The initial screen when the application is loaded is shown below. AJAX call is made to

load the senator list.

If the application is refreshed, the data should be loaded from the local storage:

After a few drag and drops, the application looks like this:

Note that the democrats can only be dropped into the Democrats area. Similarly for the

Republicans. You cannot drag and drop the member already voted.

If the application is quit and then reloaded, the application should resume from the last


Part3 – Web Workers and Local Storage (30 Points)

Your web application starts 5 web workers (computeWorker.js) and sends the messages

to them to compute the sum of all the integers from the specified start value to the

specified end value. The two values are send as a JSON object having start and end

properties. The web worker computes the sum of all the integers from the specified start

value to the specified end value and sends back the result. The result is sent as a JSON

object having start, end, and result properties. The main web application stores all the

results it receives in local storage.

a) Show the JavaScript code for computeWorker.js.

b) Show the code for the main web application starting the workers and sending

them the messages. The values send for the five web workers can be (1, 1000),

(1001, 2000), (2001, 3000), (3001, 4000), and (4001, 5000), respectively.

c) Show how you will use local storage to record the results as they are being

received. Use a single key in the local storage and store the results received into

an array. Update the user interface as the results arrive from the workers.

Submission: Export your HW2_lastName folder as a zip file, with the

appropriate index.html for the above files, and upload the zip file to the

Assignment section.

Order a unique copy of this paper
(550 words)

Approximate price: $22

Place Order
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

We value our customers and so we ensure that what we do is 100% original..
With us you are guaranteed of quality work done by our qualified experts.Your information and everything that you do with us is kept completely confidential.

Zero-plagiarism guarantee

The Product ordered is guaranteed to be original. Orders are checked by the most advanced anti-plagiarism software in the market to assure that the Product is 100% original. The Company has a zero tolerance policy for plagiarism.

Read more

Free-revision policy

The Free Revision policy is a courtesy service that the Company provides to help ensure Customer’s total satisfaction with the completed Order. To receive free revision the Company requires that the Customer provide the request within fourteen (14) days from the first completion date and within a period of thirty (30) days for dissertations.

Read more

Privacy policy

The Company is committed to protect the privacy of the Customer and it will never resell or share any of Customer’s personal information, including credit card data, with any third party. All the online transactions are processed through the secure and reliable online payment systems.

Read more

Fair-cooperation guarantee

By placing an order with us, you agree to the service we provide. We will endear to do all that it takes to deliver a comprehensive paper as per your requirements. We also count on your cooperation to ensure that we deliver on this mandate.

Read more

Calculate the price

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages