Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This project will allow you to practice the material from the first 3 modules. Please, read through the instructions completely before starting so that you

This project will allow you to practice the material from the first 3 modules. Please, read through the instructions completely before starting so that you will understand what is being asked.

Chose an/a industry/category that you like. It can be anything: electronics, furniture, apple products, anything that you use or live in. Do not use the same products as a friend. The selection must be unique.

1. Select some products of the industry/ category and create an array of objects. For example, in the case of electronics you could select TV, computers, printers, etc. For furniture, you could select beds, chair, couch and so on. There are many products of any industry that can use. Feel free to use the web to research these values. The array must contain at least 10 objects Select your data from related web sites (stores, factories, etc.) Each object will have at least 4 properties with values Each object of the array should have the same set of property names with different values. o At least one string value and 2 number value o Other properties can be of any JavaScript value type

2. Create a function that: a. can make a calculation; example: one of the total inventory cost or cost of products sold of each product/object or (your could select any calculation matches your data ) b. and the output can be used to format your object in a nice string format for output. This function should be a pure function that takes one object as an argument and return a string. The string can be formatted in any way that you feel is appropriate for your data including the cost that you calculated. It must use one or more properties from the object in the output string.

3. Create a new array from your array that only contains string values produced by the above function. Sort this array alphabetically and display an appropriate heading followed by this list one string in line.

4. Prompt the user for numeric value. Display a string (formatted using the function above) for each of the objects that have a property (you choose) that are greater or less (up to you) the value provided by the user. Be sure to provide a message if there are no objects that match.

5. Calculate the average value of the calculation that you calculated of all your objects/products. Output it with descriptive text in a nicely formatted way.

Sample object from array:

{

productName: Laptop,

inventory: 12,

unitPrice: 650

brand: [HP, Acer],

unitsSold: 34

}

Sample return value from function taking the above object as an argument (Note that the parentheses are just for display, they are not required); (12) Laptop with total inventory cost of $18650

Sample Output:

Electronics: (39)

Computer with total inventory cost of $564567

(12)Laptop with total inventory cost of $18650

(2) Printer with total inventory cost of $5678

Etc

Electronics need to be ordered (less than 5):

(2) Printer with total inventory cost of $5678

(4) Projector with total inventory cost of 3421

The average of inventory sold for products is: 23456

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions