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

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

#include<iostream>
#include<conio>
using namespace std;
main()
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;
cout<<"attendance";
cin>>total number of days
cin>>days present;
cout<<"class standing";
cout<<"quizzes";
cin>>total number of items;
cin>>total score;
cout<<"major exam";
cin>>total number of items;
cin>>total score;
attendance=20
total number of days
days present
class standing=20
quizzes=20
total number of items
total score
major exam=50
total number of items
total score
prelim grade(20+20+20+50+20)/5
getch();
return 0;


    }

Edited 2 Years Ago by Dani: Formatting fixed

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.

Edited 2 Years Ago by Schol-R-LEA

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.

This article has been dead for over six months. Start a new discussion instead.