Remember to checkout the Codesnip below to review the C++ code yourself! Feel free to copy the code, but I ask that you please provide credit if you leave the code unchanged when you use it.
//Programmer: Nazmus //Website: EasyProgramming.net //Program: Array Tutorial #2 - Parallel Arrays #include <iostream> #include <string> using namespace std; int main(){ string name[3]; int test1[3]; int test2[3]; float avg[3]; int i; for(i=0;i<=2;i++){ cout << "Please enter student's name: "; cin >> name[i]; cout << "Please enter first test score: "; cin >> test1[i]; cout << "Please enter second test score: "; cin >> test2[i]; } for(i=0;i<=2;i++){ avg[i] = (test1[i] + test2[i]) / 2; } cout << endl; cout << "Name" << " " << "Average" << endl; for(i=0;i<=2;i++){ cout << name[i] << " " << avg[i] << endl; } system("pause"); }