Help with Creating classes

Program Objective:
Create class named quark which will store the name (up, down, charm, strange, top or bottom), charge (+2/3, -1/3, +2/3, -1/3, +2/3, -1/3 e) and mass (1.5-3.3, 3.5-6.0, 1,160-1,340, 70-130, 169,100-173,300 or 4,130-4,370 MeV/c^2). The quark class should be able to set and get each of the member data. The set functions should validate input values.

Create a program that creates an array of 5 quark objects, sets their values randomly and display the quarks sorted by their mass.

Include documentation for your class definition and implementation.

Member Function Names:
quark
~quark
setMass
getName
getCharge
getMass
you: <Copy/paste a homework problem without even asking a question>

me: <ignore you>
Topic line says help creating classes. Which is my question. I have never done classes before and needed help getting started. This what i have come with so far reading up on class on my own. Need to know if Im on the right track at least.

#include <cstdlib>
#include <iostream>
#include <string>



using namespace std;

class Quarks
{
private:
float charge;
double mass;
string Quarks[5] = { up, down, charm, strange, top, bottom};

public:
Quarks();
~Quarks();

setMass();
getName();
getCharge();
getMass();
};

Quarks::Quarks[0]
float charge = +2/3;
double mass = 1.5 < 3.3;


int main(int argc, char *argv[])
{
system("PAUSE");
return EXIT_SUCCESS;
}
Topic archived. No new replies allowed.