Please advise

How shall I start the following program? I have no idea and its due in 2 days. Please help. I have no clue where to start from.

1. You are to write a program that simulates the grading rules for students.
2. The program must create an array to hold the marks from 12 modules.
3. It must calculate the average mark and display a degree grade based on that mark (1st for 70+,2i for 60-70, 2ii for 50-60, and 3rd for 40-50. (Fail for an average below 40.)
4. However if they pass on average, but they have any module mark below 35, the program must instead display a message “Referred in module i” where i shows the index of the problem module, for each such module.
5. You must include a section of your program to prompt and read in from the user (with repeated reading if they enter invalid values) .

1
2
3
4
5
6
int main()
{



};
@pogrady - Wrong.

1
2
3
4
5
6
7
8
9
10
#include<iostream>

using namespace std;

int main()
{


return 0;
};
Why the semicolon after the function scope? GCC doesn't complain but I've never seen it used there.
Would anyone be willing to make this for me please? I dont understand this. I know the basic commands to start off with, however dont know how to implement the required functions
Why the semicolon after the function scope? GCC doesn't complain but I've never seen it used there.
The semicolon isn't needed but the compiler won't complain because the semicolon itself is a statement. It just dosn't do anything.

Would anyone be willing to make this for me please?

Nobody is going to do you homework for you here, it's against the site rules.
Strictly speaking, an empty statement at global scope is invalid.
> GCC doesn't complain
It does
error: extra ‘;’ [-Wpedantic]

@Olysold lol

I've always used this syntax because when i see the close brace and a semi colon i know its the end of a function, and not something else.
Last edited on
> because when i see the close brace and a semi colon
> i know its the end of a function, and not something else.

Even assuming that this does not make the program ill-formed (it does),
can you conclude that }; is the end of a function and nothing else?

1
2
3
4
5
6
7
8
9
#include <vector>

std::vector<int> foo()
{
    enum colour_t { RED, GREEN, BLUE };
    int k {25};
    auto bar = [] ( int a ) { return a+6 ; };
    return { RED, GREEN, BLUE, bar(k) };
}

Topic archived. No new replies allowed.