Question: Be sure to submit on both Replit and and a screenshot on Canvas. An IMPORTANT note about numeric literals: It is OK to use literals

Be sure to submit on both Replit and and a screenshot on Canvas.

An IMPORTANT note about numeric literals: It is OK to use literals 0 (zero) or 1 (one) to initialize variable values, but constants or variables should be used otherwise.

Besides main.cpp, folder named includes with 2 files: student.h and student.cpp.

main.cpp

Enter your first and last name at the top in comments. Include file student.h be sure to include the path as it is in a different folder. Declare a constant integer named AP_STUDENTS with a value of 2. Declare a constant integer named NBR_STUDENTS with a value of 3.

Inside the main function:

Declare a Student array named students_ap with an array size of AP_STUDENTS, and initialize the student names as: Mike Miller and Linda Lawson. Declare a Student array named students with an array size of NBR_STUDENTS.

Under the code: cout << "Enter scores for AP students "; Write a loop to call setScores for each student in the students_ap array.

Under the code: cout << "Show scores for AP students "; Write a loop to call showScores for each student in the students_ap array.

Under the code: cout << "Enter names for non-AP students "; Write a loop to call updateName for each student in the students array.

Under the code: cout << "Enter scores for non-AP students "; Write a loop to call setScores for each student in the students array.

Under the code: cout << "Show scores for non-AP students "; Write a loop to call showScores for each student in the students array.

student.h

Above the code: using namespace std; Include file iostream.

Define a class named Student with

Public members:

A static constant integer named NBR_SCORES with a value of 4. Prototype the below functions: A void function named setName with 2 string parameters for first name, and last name. A void function named updateName with no parameters. A void function named setScores with no parameters. A void function named show Scores with no parameters. A constructor with 2 string parameters each with a default value of (an empty string).

Private members:

A string named firstName. A string named lastName. An integer array named scores with an array size of NBR_SCORES. An integer named studentID. A static integer named ID.

student.cpp

Include file student.h no path needed as it is in the same folder. Initialize the private static variable ID with a value of 100.

Function definitions:

Define setName to

set the private variables firstName and lastName with the values of the parameters.

Define updateName to

prompt the user for first name and last name then call setName. For example: Enter first name for student 103: Enter last name for student 103: Note: the prompts show the student ID number. Hint: you will need 2 local string variables.

Define setScores to

prompt the user for the students scores and populate the private scores array. For example: Enter score 1 for student 101: Mike Miller Note: the prompt shows which score and the student ID number and student name. Note: you must write a loop to run NBR_SCORES times.

Define showScores to

show the scores in the private scores array as well as the average for the scores. For example: Scores for student 101: Mike Miller are 100 100 99 98 The average is: 99 Note: the output shows the student ID number and student name. Note: you must write a loop to show all of the scores. Note: write just one loop to show the scores and calculate the average.

Define the constructor to

Increment the private static variable ID then assign that value to the private variable studentID Then call setName.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!