I'm new here, and haven't posted anywhere for any help since I've been all about learning for myself. However, I've gotten to the point where I don't want to fail this class so I'm seeking as much help as I can! I don't want it done for me, just a little guidance in the right direction since I'm just at a loss as to where to continue.
The assignment asks for the input of 10 students names that are going to be stored into an array. Then I need a parallel array that will hold the final test scores of each of the students. The output should be similar to:
Joe Smith [tab] 93
... ... ...
and so forth for each of the ten students.
#include <iostream> #include <iomanip> #include <string> using namespace std; int main() // declare the variables int x = 0; // names int y = 0; // scores // declare arrays string names; int scores; // input data into the names array for (x = 0; x < 10; x++) cout << "Enter a student's name: "; cin >> names[x]; // input test data for ( y = 0; y < y; y++) cout << "Enter test score for " << names[x] << ": "; cin >> scores[y]; // display name and score // i know what all goes here, i just need to get the test data loop to work return 0; }
It asks me for the student's names but it won't ask me for the test scores. I'm uncertain as to what I'm doing wrong?