Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, I'm trying to construct a program that asks user to enter the names and ages using two dimensional arrays. I'm not sure how to
Hi, I'm trying to construct a program that asks user to enter the names and ages using two dimensional arrays. I'm not sure how to declare the data type. Please see the code below and make any corrections that are needed. Also, use C++ language for this assignment. Thanks.
#include
int main() {
int n;
string input[100];
int input[100];
cout
cin >> n;
cout
for (int i = 0; i
{
for (int j = 0; j
{
cout
cin >> input[i][j];
}
cout
}
cout
for (int i = 0; i
{
for (int j = 0; j
{
cout
}
}
return 0;
}
nt n; string input [100].: int input[100]; cout input[i][j]: cout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started