data types. The first is string array, second is char, third float, and the fourth calculates from the second and third arrays. Then it has to display array 1, 2 and 4. Oh, and I have not mentioned about input validations yet. Please! I need help. anything at all
Thank you.
Hi, I have a c++ parallel array (4 arrays) program to write. In three of the arrays the user inputs different
You need a for loop that executes the same number of times as the length of the arrays (which should all be the same length).
declare your variables
for(int i = 0; i %26lt; length of arrays; i++)
{
cin %26gt;%26gt; all of your variables, with appropriate prompts to the user;
validate inputs;
store the inputs in arrays 1, 2, and 3 at index [ i ];
calculate the value for array 4 and store it at index [ i ];
}
for(int i = 0; i %26lt; length of arrays; i++)
{
cout %26lt;%26lt; arrayOne[ i ] %26lt;%26lt; " " or whatever your formatting is;
}
do the second for loop for arrays 2 and 4
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment