for loop

I'm trying to put a max of 10 homework grades and the user choose how many homeworks to put in this is what I have so far.

#include <iostream>
#include <cmath>

using namespace std;

int main(void)

for(int i = START_VALUE; i < END_VALUE; ++i) {


system ("pause");
return (0);

Well that's a for loop. How do you want the user to choose the number? Do you want to prompt them? Do you want them to insert a negative number before you exit?

Let's start...

1. You need to define an array of 10.
2. While you are less than 10 and you are not at the user-defined end, keep reading.
What's an array of 10?
You need to use loop so that the user can input his/her desired homework grades. Just like this:

int input;
int grade[10];

cout<<"How many homework grades to input? (max of 10 only): ";

for ( int i=0; i<input && i<10; i++ )
cout<<" Enter " << i+1 << " homework grade: ";
Topic archived. No new replies allowed.