Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use JavaScript Object Notation to create a sample object for one of the places f

ID: 3736008 • Letter: U

Question

Use JavaScript Object Notation to create a sample object for one of the places from the provided dataset, with JavaScript fields for the different values (name, suburb, etc.). Create a function that takes as input two of these JSON objects and says whether they are in the same suburb or not.

A screenshot of part of the datasets are provided below.

Wifi Hotspot Name 7th Brigade Park, Chermside Annerley Library Wifi Ashgrove Library Wifi Banyo Library Wifi Booker Place Park Bracken Ridge Library Wif Brisbane Botanic Gardens Brisbane Square Library Wif Address Delaware St 450 lpswich Road 87 Amarina Avenue 284 St. Vincents Road Birkin Rd & Sugarwood St Corner Bracken and Barrett Street Mt Coot-tha Rd Brisbane Square, 266 George Street Suburb Chermside Annerley, 4103 Ashgrove, 4060 Banyo, 4014 Bellbowrie Bracken Ridge, 4017 Toowong Brisbane, 4000 Latitude Longitude 27.37893 27.50942285 27.44394629 27.37396641 27.56353 27.31797261 27.47724 27.47091173 153.04461 153.0333218 152.9870981 153.0783234 152.89372 153.0378735 152.97599 153.0224598

Explanation / Answer

Sample Objects myObj1 and myObj2-

var myObj1 = JSON.parse({ "wifi_hotspot_name":"7th Brigade Park.Chermside", "Address":"Delaware St", "Suburb":"Chermside","Latitude":"-27.37893","Longitude":"153.04461" });

//by this JSON text is converted into JS object.

var myObj2 = JSON.parse({ "wifi_hotspot_name":"Annerley Library Wifi", "Address":"450 lpswich Road", "Suburb":"Annerley,4103","Latitude":"-27.50942285","Longitude":"153.0333218" });

function fun(myObj1,myObj2){

var x = myObj1.suburb;

var y = myObj2.suburb;

var ans ="";

if(x==y){

ans = "Same Suburb";

}

else{

ans="Not Same Suburb"

}

return ans;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote