Hi there,
As previously mentioned, it's best to use codetags when posting code (click the <> button on the right of the textarea when posting or editing).
As to your problems:
1 2 3 4 5 6
|
//fgrade()
//add code here : for the input of 15 grades in 3x5 array
cout<<"ENTER GRADES FOR A 3X5 ARRAY"<<endl;
const int srows = 5;
const int scol = 3;
int grades[srows][scol];
|
First, it would be wise to turn those statements around as such:
1 2 3 4
|
const int srows = 5;
const int scol = 3;
int grades[srows][scol];
cout<<"ENTER GRADES FOR A 3X5 ARRAY"<<endl;
|
Your goal is to insert into the array, so it's best to declare the array before inputting values.
After asking the question, you will want to read the input from the user, this is done using
cin >>
.
Cout is standard output (ie screen), cin is standard input (ie keyboard).
Now, you need to fill the array - so the best thing is to ask the user for input repeatedly, which is done by loops in code. Inthis case, you'll probably want a nested loop, as described in pseudocode:
For every student (srows), use counter s
For every grade (scols), use counter g
Ask input
Store input[s][g] |
You will want to use the same algorithm for displaying the array, only rather than asking for input, you output the data.
It's a bit hard to tell from your code what else you are struggling with, please do get back to us with more specific questions about certain parts of the program you are struggling with if needed.
Hope that helps.
All the best,
NwN