for my project and am confused about the question and how to answer it

Write a C++ Program to enter the names, matric number and score of 6 courses using arrays.compute the average score and grade for each 200 student.

how do i do it?
Break the program down into its individual parts.
http://www.cplusplus.com/doc/tutorial/

Do you know how to enter a name? See http://www.cplusplus.com/doc/tutorial/basic_io/

Do you know how to deal with arrays? See http://www.cplusplus.com/doc/tutorial/arrays/

Do you know how to work with loops? See http://www.cplusplus.com/doc/tutorial/control/
i dont understand
Last edited on
can you write the programe let me see?
> can you write the programe let me see?
How did you manage to complete any of your previous assignments?

Each homework builds on the knowledge gained from previous work.
Now is not the time to come over "all stupid" all of a sudden.

The only potential issue would be "compute average".
The rest is just simple cout, cin and loops.

We're your guide to show you the way, not your mule to carry you.
Post some attempt at the problem.

i know but the program look trickish and hard, i know the lecturer himself cannot write it sef.
You are ridiculous. F off.
i dont understand

If you don't understand the rather simple text and examples of tutorials, how could you understand anything that we write?
How could you understand any piece of code that we write?

i know the lecturer himself cannot write it sef.

The lecturer knows this problem much better than us do. If he cannot do it, then you know that we cannot possibly succeed.
calm down no need for insults
What is the format of the input file? Can you give an example of input, perhaps for 3 student?

Start by writing a program to read the data for one student and compute their grade. Then it's a simple matter of putting that code in a loop to handle all the students in the file.

It's very unlikely that anyone here will write the code for you. We want you to become a good programmer and that means you need to do most of the work yourself.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <string>

int main()
{
    int current_count{3};
    
    // 200 STUDENT NAMES
    std::string name[200]{"Alice", "Bob", "Carol"};
    
    // 200 MATRIC NUMBERS
    int matric_no[200]{1320987, 8723489, 8701255};
    
    // 200 GRADES OF 6 COURSES
    int score[200][6]
    {
        85,65,99,63,87,43,
        78,56,98,23,66,74,
        99,88,77,66,55,44
    };
    
    double average{0};
    for(int student = 0; student < current_count; student++)
    {
        std::cout
        << "Name: " << name[student] << '\t'
        << "matric: "<< matric_no[student] << '\n';
        
        average = 0;
        for(int course_no = 0; course_no < 6; course_no++)
        {
            average += score[student][course_no];
            std::cout << score[student][course_no] << ' ';
        }
        std::cout << "Average: " << average/6.0 << '\n';
    }
        
    return 0;
}


Name: Alice
matric: 1320987
85 65 99 63 87 43 Average: 73.6667
Name: Bob
matric: 8723489
78 56 98 23 66 74 Average: 65.8333
Name: Carol
matric: 8701255
99 88 77 66 55 44 Average: 71.5
Program ended with exit code: 0
So if we are doing this program for 200 students, do we need to type tge 200 names, mat no and courses? What is to be done?
do we need to type [the] 200 names, mat no and courses?

I would think that the names, matrix numbers and courses come from a file of some sort. But it's your assignment, so you tell us :).

Seriously though, can you post the full assignment? We could help a lot more if we know exactly what the inputs and outputs are supposed to be.
What is to be done?

@OP
That's a great question.

I am left with a reply having a tone somewhere between the politeness of dhayden and the less than polite reply from dutch, one you thought required a call for calm.

While somewhere between the two my tone is heavily, but nevertheless calmly, toward the dutch end of the spectrum.
@againtry thanks you've done well so far
In all modesty, I know @emmility, but the next greatest question is have you?
Above all, remain calm.
Lol am here for you @againtry
Last edited on
I'll let you have the last say @emmility, but I can't help telling you, in the calmest possible tone, we are here for each other.
I can see that i just wish others are like you, the earth would be a better place to live in @againtry
Topic archived. No new replies allowed.