Create a function that gets the total amount and percentage of covid case data for each Age Group   in the covid cases data set(which contains the property "Age Group" in each case array).   Age Groups: 'younger than 18', 'between 19 to 28 Years', 'between 29 to 38 Years', 'between 39 to 48 Years', 'between 49 to 58 Years', 'between 59 to 68 Years', 'between 69 to 78 Years', 'between 79 to 88 Years', and 'older than 89'   The function getSummaryOfAges(data) should return an Object with the following structure:   {   'UnknownAge': {   totalAmount: 27,   percentageOfTotal: 0.001   },   'younger than 18': {   totalAmount: 39,   percentageOfTotal: 0.074   },   'between 19 to 28 Years': {   totalAmount: 68   percentageOfTotal: 0.124   },   'between 29 to 38 Years': {   totalAmount: 59,   percentageOfTotal: 0.100   },   ...etc   }   For the covid case Objects that don't have an Age Group value(meaning it's null).   Then these case Objects should be treated as the "UnknownAge" Age Group category   For each age category, calculate the total number of covid cases(500 cases), the total for each age group,   and finally the percentage of the total.   Update: sample data that can be used   Example of case object:   Case = {     {       "Age Group": "20 to 29 Years",       "Fitness": "ACTIVE",       "Gender Person": "FEMALE",     },     {       "Age Group": "20 to 29 Years",       "Fitness": "ACTIVE",       "Gender Person": "FEMALE",     },     {       "Age Group": "20 to 29 Years",       "Fitness": "ACTIVE",       "Gender Person": "MALE",     },

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

[Javascript - Question]

 

Create a function that gets the total amount and percentage of covid case data for each Age Group

 

in the covid cases data set(which contains the property "Age Group" in each case array).

 

Age Groups: 'younger than 18', 'between 19 to 28 Years', 'between 29 to 38 Years', 'between 39 to 48 Years', 'between 49 to 58 Years', 'between 59 to 68 Years', 'between 69 to 78 Years', 'between 79 to 88 Years', and 'older than 89'

 

The function getSummaryOfAges(data) should return an Object with the following structure:

 

{

 

'UnknownAge': {

 

totalAmount: 27,

 

percentageOfTotal: 0.001

 

},

 

'younger than 18': {

 

totalAmount: 39,

 

percentageOfTotal: 0.074

 

},

 

'between 19 to 28 Years': {

 

totalAmount: 68

 

percentageOfTotal: 0.124

 

},

 

'between 29 to 38 Years': {

 

totalAmount: 59,

 

percentageOfTotal: 0.100

 

},

 

...etc

 

}

 

For the covid case Objects that don't have an Age Group value(meaning it's null).

 

Then these case Objects should be treated as the "UnknownAge" Age Group category

 

For each age category, calculate the total number of covid cases(500 cases), the total for each age group,

 

and finally the percentage of the total.

 

Update: sample data that can be used

 

Example of case object:

 

Case = {

 

  {

 

    "Age Group": "20 to 29 Years",

 

    "Fitness": "ACTIVE",

 

    "Gender Person": "FEMALE",

 

  },

 

  {

 

    "Age Group": "20 to 29 Years",

 

    "Fitness": "ACTIVE",

 

    "Gender Person": "FEMALE",

 

  },

 

  {

 

    "Age Group": "20 to 29 Years",

 

    "Fitness": "ACTIVE",

 

    "Gender Person": "MALE",

 

  },

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY