Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c++ help Write a program that: Creates two finite arrays of size 10 These arrays

ID: 3899401 • Letter: C

Question

c++ help

Write a program that: Creates two finite arrays of size 10 These arrays will serve as a storing mechanism for student grades in Classes A and B Uses a loop to populate the arrays with randomly generated numbers from 0 to 100.These numbers will represent student grades. Compute average grade of each class. Finally, output the two arrays and the message with two averages and best class. ("Class A average is: 65.43; class B average is: 68.90. Class B wins!") Please Note: To generate random numbers you will use the function srand0. srand0 function takes a seed value. You are required to ask the user to input a seed value. And please call srandO function using the seed value entered by the user. For example: int seed_value cin>>seed value; srand (seed_value) /I this is how srand) function will get called in your code 3 - Sample Output For example, suppose the array for class A looks like int class-A [10] = {10, 20, 30, 40, 50, 60, 70, 80, 90·10} · Suppose the array for class B looks like int classB [10 (21, 10, 19, 17,80,100, 50, 30,22,5 The output should be Class A average is: 46 Class B average is: 35.4 Class A wins!

Explanation / Answer

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

int main()
{
int seed_value;
cout << "Enter the seed value:" << endl;
cin >> seed_value;
srand (seed_value);
int A[10],B[10];
for(int i=0;i<10;i++) {
A[i]=rand() % 101;
B[i]=rand() % 101;
}
int classASum = 0,classBSum = 0;
double classAAverage,classBAverage;
for(int i=0;i<10;i++) {
classASum+=A[i];
classBSum+=B[i];
}
classAAverage = classASum/10.0;
classBAverage = classBSum/10.0;
cout<<"Class A average: "<< classAAverage<<endl;
cout<<"Class B average: "<< classBAverage<<endl;
if(classAAverage<classBAverage) {
cout<<"Class B wins"<<endl;
} else {
cout<<"Class A wins"<<endl;
}
return 0;
}

Output:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote