Question

write a program that automates the process of generating the final student report for DC faculty...

write a program that automates the process of generating the final student report for DC faculty considering the following restrictions.

1. Consider declaring three arrays for processing the student data:

1. The student ID is a random number generated by the 5-digit system in the range of (10000 - 99999). Create a function to assign the student ID generated in an array of numbers.

Consider the following to generate the random number:

1. Add the libraries: #include <stdlib.h> #include <ctime>

2. In the main function add the instruction that generates unique values:

srand(time(0))

1. Use the following formula to generate the random number in the range of the minValue = 10000 and maxValue = 99999:

randomNumber = (rand() % (maxValue- minValue + 1)) + minValue;

Use studID for the name of the array.

1. Student names must be assigned when the array is declared. Use studName for the name of the array.

Example:

string studName[] = { "Adam", "Josue", "Carlos", "Frank", "Alison",

"Adrian" , "Candy", "Steven", "Albert", "Alice" };

1. Create a function to read student grades and store them in the student grade array. The program must validate that the range of possible values is from 0 to 100. If an incorrect value is entered, the system must ask again for this grade. Use studGrade for the name of the array. Consider the following code example for validation.

{

for (int index = 0; index < A_SIZE; index++)

{

do

{

}

}

1. Create a function to calculate the grade with letter that corresponds to the numeric grade and show it as part of the report. Generate a new array (studGradeLetter) to assign the letter that corresponds to the numeric grade. Consider the following example code.

{

//Process the student's grades and assign the letter that corresponds to the grade

for (int index = 0; index < A_SIZE; index++)

{

1. Create a function to calculate the number of students per grade (grade letter), and display the counter in the output report.

1. Create a function to calculate the total number of students approved or failed. Display the result in numeric format and percentage. Example:

Hint: % Approved Students = (Total Approved * 100) / Total Students

% Fail Students = (Total Failed * 100) / Total Students

1. Create a function to search for the student (s) with the highest grade. Display the result with the below data students.

Consider the following example code:

for (int index = 0; index < A_SIZE; index++)

{

cout << studID[index] << ' ' << studName[index]

<< ' ' << studGrade[index] << ' ' << studGradeLetter[index] << endl;

}

1. Create a function to calculate the general average of the course. Display the result in the output report. For example:

1. The final report should include the information below: Example Output:

Please find below the code, code screenshots and output screenshots. Please refer to the screenshot of the code to understand the indentation of the code.  PPlease get back to me if you need any change in the output report as you have not added the sample output report. Else please upvote.

CODE:

#include <iostream>

#include <stdlib.h>

#include <ctime>

#define A_SIZE 10 //Declare number of students as constant

using namespace std;

//Function prototype

//main function

int main()

{

//Array declaration and initialization for students names

string studName[] = { "Adam", "Josue", "Carlos", "Frank", "Alison", "Adrian" , "Candy", "Steven", "Albert", "Alice" };

int studID[A_SIZE]; //declaring array for storing student id's

//Variables used for random number generator

int minValue = 10000;

int maxValue = 99999;

int randomNumber;

// Use current time as seed for random generator to prevent randomNumber repetition

srand(time(0));

for(int index = 0; index<A_SIZE; index++){ //loop through each student index

randomNumber = (rand() % (maxValue - minValue + 1)) + minValue; //generate the random number between the range

studID[index] = randomNumber; //assign randomNumber generated to studId

}

//calling functions to generate the final report

return 0;

}

/***********************************************************

* Return Value: None

* *********************************************************/

{

for (int index = 0; index < A_SIZE; index++) {

do {

cout << "Grade of Student "<<index+1<<": ";

}

}

/***********************************************************

* Function to Process the student's grades and

* assign the letter that corresponds to the grade

* Return Value: None

* *********************************************************/

{

//Process the student's grades and assign the letter that corresponds to the grade

for (int index = 0; index < A_SIZE; index++){

else if(studGrade[index] < 60) //less than 60

}

}

/***********************************************************

* Function to calculate the number of students per grade (grade letter),

* approved or failed

* Return Value: None

* *********************************************************/

{

//Initialize counter Variables as 0

for (int index = 0; index < A_SIZE; index++){ //loop through each student grade letter

//Increment appropriate counter for each grade letter

}

}

//displaying the counter in the output report.

}

/***********************************************************

* Function to calculate the total number of students

* approved or failed

* Return Value: None

* *********************************************************/

{

int total_approved = 0;

int total_failed = 0;

float percentage_approved;

float percentage_failed;

for (int index = 0; index < A_SIZE; index++){ //loop through each student grade letter

total_failed++;

else

total_approved++; //else increment total_approved

}

//calculate percentage of Approved and Failed Students

percentage_approved = (total_approved * 100)/ A_SIZE;

percentage_failed = (total_failed * 100)/ A_SIZE;

//Displaying the result in numeric format and percentage

cout <<"\n\nNumber of Approved Students: " << total_approved;

cout <<"\nNumber of Failed Students: " << total_failed;

cout <<"\nPercentage of Approved Students: " << percentage_approved <<"%";

cout <<"\nPercentage of failed Students: " << percentage_failed <<"%";

}

/******************************************************************

* Function to search for the student (s) with the highest grade.

* Return Value: None

* ***************************************************************/

{

cout <<"\n\nStudents with the highest grade 'A': " << endl;

for (int index = 0; index < A_SIZE; index++){ //loop through each student grade letter

if (studGradeLetter[index] == 'A') //If grade letter if 'A', dislay the student details

cout << studID[index] << ' ' << studName[index] << ' ' << studGrade[index] << ' ' << studGradeLetter[index] << endl;

}

}

/******************************************************************

* Function to calculate the general average of the course

* Return Value: None

* ***************************************************************/

{

float average;

for (int index = 0; index < A_SIZE; index++){ //loop through each student grade Value

}

average = total_grade/A_SIZE; //calculating the average of course

//Displaying the average in output report

cout <<"\nAverage of the course: " << average;

}

OUTPUT:

Earn Coins

Coins can be redeemed for fabulous gifts.