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

c#6 Read in the following data from a text file (has been saved in JSON format )

ID: 3931842 • Letter: C

Question

c#6

Read in the following data from a text file (has been saved in JSON format )

Output the data to the console:

[{"Name":"4 Person Tent","SKU":"CA24398","Color":"Blue","Quantity":2,"PriceEach":99.99},{"Name":"Sleeping Bag","SKU":"CA98345","Color":"Red","Quantity":4,"PriceEach":64.99},{"Name":"Fly Rod","SKU":"FI3048-P","Color":"Brown","Quantity":7,"PriceEach":129.99},{"Name":"Tackle Box","SKU":"FI7423-T","Color":"Tan","Quantity":20,"PriceEach":19.99},{"Name":"Deer Stand","SKU":"HU1337X","Color":"Camo","Quantity":2,"PriceEach":84.99}]

Output should be as follows:

Create a collection of that class and populate from the JSON data

Calculate the total inventory cost of the list and print to the screen

Name 4 Person Tent SKU CA24398 Color Blue Quantit Price Each $99.99 Sleeping Bag Fly Rod Tackle Box CA98345 Red $64.99 F13048-P FI7423-T HU1337X Brown $129.99 Tan 20 $19.99 Deer Stand Camo $84.99

Explanation / Answer

we have created as collectione as products in db please use as following code for the same.

db.products.aggregate([

{ $group:{ _id : null, total: {$sum: "$Quantity"}}

}

])

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