Question: Using the json file below titled donuts.json [ { id : 0 0 0 1 , type: donut, name: Cake, ppu:

Using the json file below titled "donuts.json"
[
{
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"batters":
{
"batter":
[
{"id": "1001", "type": "Regular" },
{"id": "1002", "type": "Chocolate" },
{"id": "1003", "type": "Blueberry" },
{"id": "1004", "type": "Devil's Food" }
]
},
"topping":
[
{"id": "5001", "type": "None" },
{"id": "5002", "type": "Glazed" },
{"id": "5005", "type": "Sugar" },
{"id": "5007", "type": "Powdered Sugar" },
{"id": "5006", "type": "Chocolate with Sprinkles" },
{"id": "5003", "type": "Chocolate" },
{"id": "5004", "type": "Maple" }
]
},
{
"id": "0002",
"type": "donut",
"name": "Raised",
"ppu": 0.55,
"batters":
{
"batter":
[
{"id": "1001", "type": "Regular" }
]
},
"topping":
[
{"id": "5001", "type": "None" },
{"id": "5002", "type": "Glazed" },
{"id": "5005", "type": "Sugar" },
{"id": "5003", "type": "Chocolate" },
{"id": "5004", "type": "Maple" }
]
},
{
"id": "0003",
"type": "donut",
"name": "Old Fashioned",
"ppu": 0.55,
"batters":
{
"batter":
[
{"id": "1001", "type": "Regular" },
{"id": "1002", "type": "Chocolate" }
]
},
"topping":
[
{"id": "5001", "type": "None" },
{"id": "5002", "type": "Glazed" },
{"id": "5003", "type": "Chocolate" },
{"id": "5004", "type": "Maple" }
]
}
]
Create an ordering system for donuts. The program must use vectors and map and importing of a json file.The goal is to learn how to filter and find data in a json file using C++.
sample output looks like this:
Choose a donut type:
0001: Cake
0002: Raised
0003: Old Fashioned
0001
Choose a batter type:
1001: Regular
1002: Chocolate
1003: Blueberry
1004: Devil's Food
1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!