Answer to Question #344346 in C++ for Kim

Question #344346

Create a program that will allow user to enter 10 names od teacher A's students to be stored in array name stud_name then display vertically

1
Expert's answer
2022-05-24T13:54:18-0400
#include <iostream>
#include <string>
using namespace std;

int main() {
    string stud_name[10];
    int i;
    cout << "Enter 10 names od teacher A's students: " << endl;

    // storing information
    for( i = 0; i < 10; ++i)    {
        cout<<i+1<<". ";
        getline(cin, stud_name[i]);
                }
   // display information
    cout<<endl<<"Students: "<<endl;    
     for( i = 0; i < 10; ++i)    
        cout<< stud_name[i]<<endl;
            
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS