Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Practice program (using arrays....something I don't quite understand)
Hello all, my C++ instructor gave us a practice program to write (in preparation for our upcoming exam). It involved arrays. I am awful at C++ and don't know where to begin. If anyone could give me any pointers or hints or a little code; that would be fantastic!
Here's the beginning 2 steps:
1. Declare an array to hold 200 integers (which represent scores) and fill it with random values in the range of 50 to 100. Then place the value 100 in the very first array element and the value 45 in the very last. Implement this as a function.
2. Display the elements of the array, 20 per line with space between each number. Each number should take up the same amount of space (the same width) on the screen Write a second function to do this. It should begin by displaying a title: "The Array". Hint: as you go through the array, displaying the elements, check the each subscript before displaying the element - if the subscript is a multiple of 20, output an endl first.
0 · ·