Basic Arrays Assignment (stuck)

Hi everyone, I'm in a intro to C++ class and my teacher gave us this assignment with out going over arrays in very much detail.

Problem:

First, make an array to use later in the program:

1. Array of ints of size 90 (not dynamic)
2. Init all values to 0 (that's the curly braces thing)
3. Loop through the array and set each value to a random number between 2 and 9
4. Print the array with a separate for loop. Put a space between each number
5. Now use that array to do the following:

1. Ask the user what index they want to change
2. If it is out of bounds, don't exit the program, just ask again.
3. Ask the user what the new value should be
4. Reprint the array
5. Keep doing this until they enter -1 for the index

This is probably easy for someone but I'm new to coding. This is the little bit I've done so far.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 int main()
{
    //Array of ints of size 90 (not dynamic)
    int arraySize[90] = {}
    
    //Init all values to 0 (thats the curly braces thing)
    
    
    //Loop through the array and set each value to a random number between 2 and 9
    
    
    //Print the array with a separate for loop.Put a space between each number
}


I know I have a long way to go so any help is very much appreciated. Thank you!
Try making the loop to set the value of each entry, then show us that
Topic archived. No new replies allowed.