Make an Application which ask to give a data file in JSON format (below) and sto
ID: 3831950 • Letter: M
Question
Make an Application which ask to give a data file in JSON format (below) and store it in a Tree. It must also allow a user to convert Tree data into a JSON file. It allow user to add or delete and show/display all data from the given Tree. { "items" : { "item" : [ { "batters" : { "batter" : [ { "id" : 1001, "type" : "Regular" }, { "id" : 1002, "type" : "Chocolate" }, { "id" : 1003, "type" : "Blueberry" }, { "id" : 1004, "type" : "Devil's Food" } ] }, "id" : "0001", "name" : "Cake", "ppu" : 0.55, "toppings" : { "toping" : [ { "id" : 5001, "type" : "None" }, { "id" : 5002, "type" : "Glazed" }, { "id" : 5003, "type" : "Sugar" }, { "id" : 5004, "type" : "Maple" } ] }, "type" : "donut" }, { "id" : "0002", "name" : "Cake", "ppu" : 0.75, "type" : "cake" } ] } }
Explanation / Answer
The JSON should all be data, and if you include a comment, then it will be data too.
You could have a designated data element called "_comment" (or something) that would be ignored by apps that use the JSON data.
You would probably be better having the comment in the processes that generates/receives the JSON, as they are supposed to know what the JSON data will be in advance, or at least the structure of it.
But if you decided to:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.