two .cpp and one .h

I need this program to run and it includes the header and both .cpp files needed. I am having a really bad time with this one, completly lost with this one. Any tips or code hints would be great.

//Header
class Counter
{
private:
int count;
public:
void increment();
void decrement();
void reset();
int getCount();
};

//couting.cpp
#include <iostream>
#include "counter.h"


void Counter::increment()
{
count++;
}
void Counter::decrement()
{
count--;
}
void Counter::reset()
{
count = 0;
}
int Counter::getCount()
{
return getCount;
}

//counted.cpp
#include <iostream>
#include "counter.h"
using namespace std;

//Function for student information. Usable for all projects.
void studentInfo()
{
cout << "Randy Watson\n";
cout << "CNS 1400\n";
cout << "Project 9: Counter Class\n";
}

int one = 1;
int two = 2;
int three = 3;
int four = 4;
int five = 5;
int choice;
int main()
{
studentInfo ();

myCounter.reset();
do
{
cout << "Counter Program\n";
cout << "Select from the following list:\n";
cout << "1 to increment the counter\n";
cout << "2 to decrement the counter\n";
cout << "3 to display the contents of the counter\n";
cout << "4 to reset the counter to zero\n";
cout << "5 to exit the program\n";
cin >> choice;
if (choice != one || choice != two || choice != three || choice != four || choice != five)
{
cout << "Please try again\n";
cout << "Counter Program\n";
cout << "Select from the following list:\n";
cout << "1 to increment the counter\n";
cout << "2 to decrement the counter\n";
cout << "3 to display the contents of the counter\n";
cout << "4 to reset the counter to zero\n";
cout << "5 to exit the program\n";
cin >> choice;
}while (choice != five)



system ("PAUSE");
return 0;
}
Without errors, I am basically guessing...but I think the problem is you need header protection:

1
2
3
4
#ifndef HEADER_H
#define HEADER_H
//header file code
#endif 
Topic archived. No new replies allowed.