### Gotta add more to this, help!

Heres my code so far. I did everything that I was sure I knew what I was doing up to this point but here are the things I dont know how to do:

- When the user enters the 3 test scores, I gotta make it so it averages it and then displays it in the output, not sure how to do this.

- If the average is 73 or higher then it displays "Successful" and if they don't it displays "Unsuccessful". Not sure how to do this either.
 ``12345678910111213141516171819202122232425262728293031323334`` ``````#include #include #include using namespace std; class student { private : int sno; char name[20]; int g1,g2,g3; public : void Getdata() { cout << "Enter Student ID: "; cin >> sno; cout << "Enter Student NAME: "; cin >> name; cout << "Enter Student TEST SCORES (3): "; cin >> g1 >> g2 >> g3; } void Putdata() { cout << "Student ID :" << sno; cout << "Student NAME :" << name; cout << "Student TEST SCORES (3) :" << g1 << " " <
create a function that calculates the average. you need 3 input parameters and return float or double since you need to divide to get the average.

if you can't figure out how to do it, ask again
Put this on line 25
 ``123456`` `````` cout << "Average = " << (g1+g2+g3)/3 << endl; if ((((g1+g2+g3)/3) >= 73)) {cout << "Successful" << endl;} else {cout << "Unsuccessful" << endl;} }``````
Topic archived. No new replies allowed.