You are given two parallel arrays that have already been loa

You are given two parallel arrays that have already been loaded with data. The parallel arrays are: names[ ] – which includes all Student names and Score[ ] – which contains the exam score each student has received. Sample data for these parallel arrays are: names[ ] score[ ] You can assume that both arrays already exist and have been loaded with data. Write the pseudo code to output to the screen the names and score of all students with a score over 75.
12:13 oo AT&T; learn vccs.edu You are given two parallel arrays that have already been loaded with data. The parallel arrays are: names which includes all Student names and Score l-which contains the exam score each student has received. Sample data for these parallel arrays are: score[ names Name [1 Score Sara Jones Jean Baker Donna Smith Chris Johnson Clay Barker Lori Davis Ana Enrique You can assume that both arrays already exist and have been loaded with data. Write the pseudo code to output to the screen the names and score of all students with a score over 75.

Solution

/*
pseudo code:

declare and initialize arrays

iterate over the arrays
check if score is greater than 75
output name and score
end for loop

end code
*/

// C++ code
#include <iostream>
#include <fstream>
#include <cctype>
#include <cstring>
#include <stdlib.h> /* srand, rand */
#include <iomanip>
#include <limits.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
#include <string.h>

using namespace std;


int main()
{
// initialize size , name and score array
int size = 7;
string name[] = {\"Sara Jones\",\"Jean Baker\",\"Donna Smith\",\"Chris Johnson\",\"Clay Barker\",\"Lori Davis\",\"Ana Enrique\"};
int score[] = {52,93,55,78,98,68,73};

// check scores which are greater than 75
cout << \"Students withs score greater than 75:\ \";
for (int i = 0; i < 7; ++i)
{
// output the scores and name greater than 75
if(score[i] > 75)
{
cout << \"Name: \" << name[i] << \"\\t\" << \"Score: \" << score[i] << endl;
}
}

return 0;
}

/*
output:

Students withs score greater than 75:

Name: Jean Baker Score: 93
Name: Chris Johnson Score: 78
Name: Clay Barker Score: 98


*/

You are given two parallel arrays that have already been loaded with data. The parallel arrays are: names[ ] – which includes all Student names and Score[ ] – w
You are given two parallel arrays that have already been loaded with data. The parallel arrays are: names[ ] – which includes all Student names and Score[ ] – w

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site