create a program that can compute prelim grades

attendance 20
total # of days
days present
class standing20
quizzes 20
major exam 50
total # items
total score
prelim grades

Recommended Answers

All 5 Replies

do your own homework

only ask here once you've done some work yourself, show us the code and explain where you are getting stuck

using namespace std;
int attendance,total number of days,days present,class standing, quizzes, total number of items,total score, major exam, total number of items, total score,prelim grades;
cin>>total number of days
cin>>days present;
cout<<"class standing";
cin>>total number of items;
cin>>total score;
cout<<"major exam";
cin>>total number of items;
cin>>total score;
total number of days
days present
class standing=20
total number of items
total score
major exam=50
total number of items
total score
prelim grade(20+20+20+50+20)/5
return 0;


OK, you have some pseudo-code outlining the basic direction of the program, but you haven't told us what you are having trouble with yet. It isn't clear if the pseudo-code is yours or if it was provided as part of the assignment, though if the latter, it has some definite problems. Can you give us more detail as to where you are having difficulties, please?

I should add that the fact that you are using the conio library is concerning, as it is not a standard library at all, being tied specifically to the old MS-DOS system, and it is used in your pseudo-code just for the purpose of pausing the screen, which shouldn't be necessary with a current IDE (and can be achieved in other fashions in any case). If your instructor directed your to use that, it is a Bad Sign regarding the course.

Im having trouble with my coding in c++ can someone teach me

That's an extremely broad request, and one that on the face of it we as a forum couldn't really fulfill. We can give assistamce, as best we can, but providing a full course on C++ goes well beyond what we can do here. You really ought to speak to your instructor for further aid.

I can give you some help, certainly. The first thing of note is the structure of the main function, which is important because all other functions you will write follow the same basic design. The main function consists of a return value - which in thish case must always by int - the name of the function, which is main, and the argument list, which can be either an empty list, (), or the two standard command-line parameters, (int argc, char* argv[]). This is followed by a block, which is an open brace, {, the code you want in the program, a return 0; statement, and a close brace, }. Putting it together, it should be

int main()
    // your program here
    return 0;

Note the way I indented the code inside the body of the function. This is very important for making the function readable. While the language does not require indentation, you should always format the code in some manner to make it easier to read. There are several indent styles one can choose from, each with its own advantages and disadvantages, but the important thing is to choose a style you are comfortable with and be consistent in applying it.

If you have any specific questions, feel free to ask us.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.