Define a Student class and its child class HS_Student and MS_Student. ◆ HS_Student: name (string), grade (int), activity (string) MS_Student: name (string), grade (int), mathScore (int), scienceScore (int) ◆ Create two dynamic arrays - one for HS_Student, the other for MS_Student. Output . . MS_Student: Average of math and science scores for each grade level HS_Student: Number of students in the same activity in each grade Problem 2. MS.txt Paul 6 80 90 Oliver 7 82 79 Eugene 8 70 80 Tom 8 89 93 Sue 7 79 82 Harry 8 68 78 Tim 8 90 76 Eileen 7 83 79 Suzy 8 90 90 Erin 7 66 77 April 6 70 80 Jennifer 8 79 81 Eric 7 60 68 Brian 6 82 71 HS.txt Alice 10 swimming Paul 11 band Cindy 10 soccer Hailey 10 swimming Ara 9 wrestling Sally 9 band Peter 9 polo Jenny 11 band Tammy 10 band Robert 12 polo Pam 11 soccer Eve 10 polo Jessica 9 soccer David 9 swimming Sandy 9 band Olivia 9 band Phoebe 10 soccer Ken 10 soccer Bill 11 band Dolly 11 band CSOLABLE High School Students Grade 9 swimming: 1 band: 3 polo 1 wrestling 1 soccer 1 Grade 10 swimming : 2 band: 1 polo 1 soccer : 3 Grade 11 band: 4 soccer 1 Grade 12 polo 1 Middle School Students 6th grade 77.33 80.33 7th grade : 74.00 77.00 8th grade : 81.00 83.00
Define a Student class and its child class HS_Student and MS_Student. ◆ HS_Student: name (string), grade (int), activity (string) MS_Student: name (string), grade (int), mathScore (int), scienceScore (int) ◆ Create two dynamic arrays - one for HS_Student, the other for MS_Student. Output . . MS_Student: Average of math and science scores for each grade level HS_Student: Number of students in the same activity in each grade Problem 2. MS.txt Paul 6 80 90 Oliver 7 82 79 Eugene 8 70 80 Tom 8 89 93 Sue 7 79 82 Harry 8 68 78 Tim 8 90 76 Eileen 7 83 79 Suzy 8 90 90 Erin 7 66 77 April 6 70 80 Jennifer 8 79 81 Eric 7 60 68 Brian 6 82 71 HS.txt Alice 10 swimming Paul 11 band Cindy 10 soccer Hailey 10 swimming Ara 9 wrestling Sally 9 band Peter 9 polo Jenny 11 band Tammy 10 band Robert 12 polo Pam 11 soccer Eve 10 polo Jessica 9 soccer David 9 swimming Sandy 9 band Olivia 9 band Phoebe 10 soccer Ken 10 soccer Bill 11 band Dolly 11 band CSOLABLE High School Students Grade 9 swimming: 1 band: 3 polo 1 wrestling 1 soccer 1 Grade 10 swimming : 2 band: 1 polo 1 soccer : 3 Grade 11 band: 4 soccer 1 Grade 12 polo 1 Middle School Students 6th grade 77.33 80.33 7th grade : 74.00 77.00 8th grade : 81.00 83.00
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Use C++

Transcribed Image Text:### Problem Overview
This exercise involves designing a class hierarchy to manage student data for both high school and middle school students. The task includes defining a base class, `Student`, and its child classes, `HS_Student` and `MS_Student`. Each student class will store relevant information and perform specific calculations based on the data.
#### Class Definitions
- **Student Class**: This is the base class.
- **HS_Student Class**:
- **Attributes**:
- `name`: string
- `grade`: integer
- `activity`: string
- **MS_Student Class**:
- **Attributes**:
- `name`: string
- `grade`: integer
- `mathScore`: integer
- `scienceScore`: integer
#### Tasks
1. **Dynamic Arrays**: Create two dynamic arrays:
- One for `HS_Student`
- Another for `MS_Student`
2. **Output Requirements**:
- For `MS_Student`: Calculate and display the average of math and science scores for each grade level.
- For `HS_Student`: Report the number of students participating in the same activity within each grade.
### Sample Data and Calculations
#### Data:
- **MS.txt** contains students' names, grades, and their math and science scores.
Example Entries:
```
Paul 6 80 90
Oliver 7 82 79
Eugene 8 70 80
```
- **HS.txt** contains students' names, grades, and their activities.
Example Entries:
```
Alice 10 swimming
Paul 11 band
Cindy 10 soccer
```
#### Output:
- **High School Students by Grade and Activity**:
- Grade 9:
- Swimming: 1
- Band: 3
- Polo: 1
- Wrestling: 1
- Soccer: 1
- Grade 10:
- Swimming: 2
- Band: 1
- Polo: 1
- Soccer: 3
- Grade 11:
- Band: 4
- Soccer: 1
- Grade 12:
- Polo: 1
- **Middle School Students' Average Scores by Grade**:
-
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 11 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education