Question: The Below Programs should be written in Java Script. Chose an activity/product that you like. It can be anything: sports that you watch or participate
The Below Programs should be written in Java Script.
Chose an activity/product that you like. It can be anything: sports that you watch or
participate in, collecting, hobbies, industries, etc. Do not use a collection of movies since
we have covered that in the assignment.
1. Select some aspect of the activity and create array of objects donating that aspect. For example, in the case of movies themselves or you could select movies stars producers, soundtracks, etc. There are many aspects of any activity that can use. Feel free to use the web research these values. The array must contain at least 10 objects The data must be actual data not just gibberish 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 one number value
o Other properties can be of any JavaScript value type
2. Create function that 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. It must use one or more properties from the object in the output string.
3. Create 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 based on some property of your objects that makes sense. Output it with descriptive text in a nicely formatted way.
Example:
Sample input object from array:
{
title: 'La Haine',
year: 1995,
rating: 0.1,
genres: ['Crime', 'Drama],
director: 'Mathieu Kassovitz'
}
Sample return value from function taking the above object as an argument (Note that the
parentheses are just for display, they are not required);
"La Haine (1995) by Mathieu Kassovitz"
Sample Output:
Movie Titles:
12 Angry Man (1957) by Sidney Lumet
Chak de! India (2007) by Shimit Amin
Hera Pheri (200) by Priyadarshan
La Haine (1995) by Mathieu Kassovitz
Pulp Fiction (1994) by Quentin Tarantino
Schinder's List (1983) by Steven Spielberg
The dark Knight (2008) by Christopher Nolan
The Goodfather (1972 by Francis Ford Coppola
The Good, the Bad and he Ugly (1966) by Sergio Leone
The Lord of the Ring: The Return of the Kind (2003) by Peter Jackson
The Shawshank Redemption (1994) by Frank Darabont
Movies newer than 2005:
Chak de! India (2007) by Shimit Amin
The dark Knight (2008) by Christopher Nolan
The average age of these movies is: 31 years old.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
