i dont know how to make an array so that you can input a number.. it will do the calculations and keep putting these numbers into the array until the number is equal to 1 then output the numbers in the array.... this is what i have so far im just lost, my book is not very explanatory
#include <cstdlib>
#include <iostream>
#include <cmath>
usingnamespace std;
int main(int argc, char *argv[])
{
int x;
char again;
//programmer info
cout << "Programmer Name: Brandon Holtz\n";
cout << "Program 3 Description: Analyzes sequences, etc..\n";
cout << "CS150 Spring 2011, CRN 26670\n\n";
//prmpts the user for an integer
do { cout << "Enter a nonnegative integer please ";
cin >> x;
//makes calculations
if (x % 2== 0)
cout << x / 2 ;
else
cout << (x * 3) +1;
cout << "Would you like to try again? (Enter Y or N) ";
cin >> again;
}
while (again == 'Y' || again == 'y'); //loops if the user wants it to
return 0;
system("PAUSE");
return EXIT_SUCCESS;
}