Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to compute my grades on c++

+5 votes
asked Apr 27 by Joseph Stalin (170 points)
i tried

  result = math + english + science + socialscience + Computer / 12;

and i dont know if i actually wrote it right, can someone help me compute my grades ( its for a activity)

2 Answers

0 votes
answered Apr 28 by Peter Minarik (63,140 points)
First of all, you have to know your maths. Division has higher precedence (is done before) than addition.

Also, why divide by 12?

If you want to calcualte the average grade, it is:

average = (maths + english + science + socialScience + computerScience) / 5;

We divide by 5 as you had 5 elements summed.
0 votes
answered Apr 29 by userdotexe (1,340 points)

I think what you're trying to do is compute your GPA (Grade Point Average).

I made a C++ project that does this it's here: https://onlinegdb.com/VIXwTyb3l.

:)

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...