Classes

I am very new to programming and I have been trying to grasp the use of classes in C++
I am trying to compile but errors at line 27 which I am not seeing or understanding (new type may not be defined) Line 28 expected declaration before token.
Can anyone guide me.

// This program is designed to accept a student % grade and then display the letter grade.
// 80-100 A
// 70-79 B
// 60-69 C
// 50-59 D
// 40-49 E
// 0-39 F

# include <iostream>
using namespace std;



class sgrade
{
private:
int grade;

public:
void storegrade (int);
void assign ();


}
void sgrade :: storegrade(int g1)

grade = g1;
};
void sgrade::assign
{
if grade <= 100 && grade >79 then
{
cout<< "A";
cout<<endl;
};
};

int main()
{
sgrade studentgrade;
studentgrade.store;
studentgrade.assign;

cout<<"Enter Grade:\n";
cin>> num1;
cout<< endl;
}

if grade <= 100 && grade >79 then


I believe in C++ you need parenthesis for IF statement. E.g if ( grade <= 100 && grade >79 ) then do something..

If you want more freedom language syntax expression, try Perl :)
The errors are generated long before reaching the if statement. the error start at grade=g1. without solving this I am unable to analyse my if state,ment. remember I am very new to programming
Found the error, I placed a semi colon after the bracket just before void sgrade and it worked.
};
void sgrade :: storegrade(int g1)
Topic archived. No new replies allowed.