Question

In: Computer Science

In this assignment, you will create a well-formed JSON object which encapsulates the information specified. Alignment...

In this assignment, you will create a well-formed JSON object which encapsulates the information specified.

Alignment

This assignment aligns with the following objectives:

  • Identify the differences between these three modes of interacting with data, i.e. web forms, programs, and APIs
  • Recognize well-formed JSON objects
  • Parse JSON objects

Details

Imagine that using the API provided by a service like Yelp (let's call it YelpYou) you have extracted information about Sichuan Dragon, which has three branches (restaurants) in New York City. The YelpYou API will return the information in the form of a JSON object. Your assignment is to write the JSON object that YelpYou API might possibly return. Imagine that this JSON object (and JSON objects for other restaurants in NYC) is consumed by a program that strips the information from the JSON objects and feeds it to an analytical pipeline.

The information given is that Sichuan Dragon cuisine is Chinese, region Sichuan. Its cost level is '$$', decor is casual, noise level is average, it doesn't have Wi-Fi, it takes Visa, MasterCard, and Discover credit cards. For each branch of Sichuan Dragon, it gives the address of each of branch, its phone number, its web-site URL, and its customer rating. It also includes for each restaurant the first sentence of three reviews with a link to 'more' of the review. For example, "Loved their pot stickers" followed by a link to the rest of the review. (Please make up this information.) You must structure your information such that information about each branch is in a JSON object, embedded in the JSON object for Sichuan Dragon.

Assessment

Total 5 points

  • Well-formed JSON object (syntactically correct whether or not it represents all the information correctly): 1 point
  • Represents all the information (whether or not properly structured and whether or not syntactically correct): 1 point
  • Represents the information about credit cards as an array: 0.5 points
  • Represents the information about reviews of a branch as a JSON object embedded in the JSON object for that branch: 1 point
  • Represents the information about each branch as an embedded JSON object in the outermost JSON object: 1.5 point

Solutions

Expert Solution

Sichuan_dragon = {

"cuisine" : "Chinese",

" region" : "Sichuan" ,

"cost_level" : "$$" ,

"noise_level" : "average" ,

" wifi_availability" : "not available" ,

"payment_via" : [ "Visa" "Master card", "Discover credit cards" ] ,

   "branches" :3 ,

"branch1" : {

"address" : {Some random restaurant address} ,

" contact_num" : {A random phone number} ,

"url" : {Random website address} ,

" cust_rating" : {A number between 0 and the maximum} ,

" reviews" : {

"1" : "First sentence of review 1...." ,

"view_rev1" : {the link} ,   

"2" : "First sentence of review 2....." ,

"view_rev2" : {the link} ,

"3" : "First sentence of review 3....." ,

"view_rev3" : {the link} } ,

"branch2" : {

"address" : {Some random restaurant address} ,

" contact_num" : {A random phone number} ,

"url" : {Random website address} ,

" cust_rating" : {A number between 0 and the maximum} ,

" reviews" : {

"1" : "First sentence of review 1...." ,

"view_rev1" : {the link} ,   

"2" : "First sentence of review 2....." ,

"view_rev2" : {the link} ,

"3" : "First sentence of review 3....." ,

"view_rev3" : {the link} } ,

"branch3" : {

"address" : {Some random restaurant address} ,

" contact_num" : {A random phone number} ,

"url" : {Random website address} ,

" cust_rating" : {A number between 0 and the maximum} ,

" reviews" : {

"1" : "First sentence of review 1...." ,

"view_rev1" : {the link} ,   

"2" : "First sentence of review 2....." ,

"view_rev2" : {the link} ,

"3" : "First sentence of review 3....." ,

"view_rev3" : {the link} }

}

{ Please replace the words given inside the {...} to the values you prefer. Also, you can change the first sentence of all the reviews }

  


Related Solutions

Assignment 4 You will be writing an inventory system that is backed by JSON data and...
Assignment 4 You will be writing an inventory system that is backed by JSON data and will be working with a starter file that contains a JSON string. The code you write will need to follow the following guidelines. You’re at work one day and your boss asks you about that fancy programming language you’ve been learning, Python. She asks you if you can use it to read JSON data from a supplier and build an inventory. “Of course!” you...
Python Assignment You will be writing an inventory system that is backed by JSON data and...
Python Assignment You will be writing an inventory system that is backed by JSON data and will be working with a starter file that contains a JSON string. The code you write will need to follow the following guidelines. The what You’re at work one day and your boss asks you about that fancy programming language you’ve been learning, Python. She asks you if you can use it to read JSON data from a supplier and build an inventory. “Of...
I need some information on how to show the code to create a JSON data structure...
I need some information on how to show the code to create a JSON data structure with food, calories, fat, protein. while using PHP. as well as be able to add an additional value through a text box if possible. The program only needs to read the json data in program and show output in the console I would like the data to be shown in a table once its been compiled.
In this assignment, which continues to build on last week's assignment, you will create a mind...
In this assignment, which continues to build on last week's assignment, you will create a mind map identifying the steps in the training process for a CRM program to help you understand the important role training plays in an organization. It further helps you understand the importance of training as you explore how training is designed, delivered, and measured for success I need more info on what a CRM is and Which training evaluation methods would you recommend to assess...
Assignment Task Java Object Orientated GUI CQ Real Estate (CQRE) has requested you to create a...
Assignment Task Java Object Orientated GUI CQ Real Estate (CQRE) has requested you to create a Swing based Java GUI application to cater their needs. Whenever CQRE receives a property sale offer from the seller, it assigns an employee exclusively to that sale offer and then lists it for sale. When the prospective buyers provide their offers for buying these properties, CQRE maintains the details of those purchase offers. You may note that there can be many purchase offers for...
For this assignment, You will create a NodeJS application which takes a city name as an...
For this assignment, You will create a NodeJS application which takes a city name as an input in its pug template. using openweathermap API, you should get the weather of that particular city and displays that information to a new pug template. You should also store the results in a file in your directory. Following are the detailed requirements. Your application should start with a pug template (similar to HTML page) which has a form with an input field and...
1. Coding Assignment the program will start the menu calling the method extractLargestAndSmallestYourName(), which is specified...
1. Coding Assignment the program will start the menu calling the method extractLargestAndSmallestYourName(), which is specified as below.  The method extractLargestAndSmallestYourName() will receive 2 array of integers as arguments, which are denoted as array number 1 and array number 2.  The method will then search for the largest value and the smallest value. The search will also track from which array(s) these values can be found; and  The information will be return an array, which has the...
Needed in C++ In this assignment, you are asked to create a class called Account, which...
Needed in C++ In this assignment, you are asked to create a class called Account, which models a bank account. The requirement of the account class is as follows (1) It contains two data members: accountNumber and balance, which maintains the current account name and balance, respectively. (1) It contains three functions: functions credit() and debit(), which adds or subtracts the given amount from the balance, respectively. The debit() function shall print ”amount withdrawn exceeds the current balance!” if the...
In this assignment you create a small project with a base class 'Account' which represents a...
In this assignment you create a small project with a base class 'Account' which represents a generic account independent of whether the account is a Client or Vendor or Bank account. Then we will define a derived class 'BankAccount' class that represents the bank account. The BankAccount class is derived from the Account class, and extends the Account class functionality. The functionality of the BankAccount class is to handle deposits and withdrawals. You create a base class called Account and...
Use the following information to create the financial statements in questions 1-3. Unless otherwise specified, the...
Use the following information to create the financial statements in questions 1-3. Unless otherwise specified, the data given are for the fiscal year 2019 as of Dec. 31. Credit will not be given unless complete financial statements are submitted. Sales revenue: $8,000 Accounts Receivable Dec. 31, 2019: $150 Tax rate: 25% Accounts Payable Dec. 31, 2019: $175 Interest expense: $70 Inventory Dec. 31, 2019: $800 SGA Expenses: $1,300 Total Expenses: $5,200 Other Revenue: $2,000 Accrued Liabilities: $550 R&D Expense: $500...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT