jcwm249 36 Newbie Poster

well how would i fix this?...I took am online self tought computer programming class so things are not that clear to me...

I usually write down a code as best as I can and then try to fix everything up by what the errors say...I know it is a bad approach but I dont know what else to do..

jcwm249 36 Newbie Poster

can anyone be specific with me on trying to figure out this error....I have been reaqding my book and looking all over the net trying to solve it but all i have left is these two errors!!!!!!!

#include <iostream>
#include <string>
#include <fstream>

using namespace std;

void add_Record();
void get_Record();


void DisplayMenu();
int GetChoice();
bool Confirm();
void ProcessChoice(int);



int main()
{
	int choice;
	bool quit = false;
	do
	{
		DisplayMenu();
		choice = GetChoice();
		if ( choice == 0 )
		{
			if (Confirm())
			quit = true;
		}
		else
			ProcessChoice(choice);

	}while (!quit);

	return 0;
}

void DisplayMenu()
{
	cout << "1) Enter new patient\n";
	cout << "2) List all smokers\n";
	cout << "3) List all Male smokers\n";
	cout << "4) List all Female smokers\n";
	cout << "5) List all with risk factor greater than 5\n";
	cout << "6) List all with risk factor less than 5\n";
	cout << "7) Search by SS number\n";
	cout << "8) List all by an age\n";
	cout << "9) List all with HBP and HFD\n";
	cout << "10) List Counts of Smokers, HFD, and HBP\n";
	cout << "0) Exit\n";
}

int GetChoice()
{
	int choice;
	cout << " Enter a choice ";
	cin >> choice;
	return choice;
}

bool Confirm()
{
	char choice = 'N';
	bool rsp = false;
	bool done = false;
	do
	{
		cout<<" Are you sure to quit (Y/N)? ";
		cin >> choice;
		choice = toupper (choice);
		if (choice == 'Y')
			rsp = true;

		if (choice == 'Y' || choice == 'N') 
			done …
jcwm249 36 Newbie Poster

Oh ok...I took out the void part of the beginning of the cases and added void get_Record(); and void add_Record(); to the very beginning, but it still left me with the last error:

1>(437) : error C2084: function 'void add_Record(void)' already has a body
1>(7) : see previous definition of 'add_Record'

jcwm249 36 Newbie Poster

Ok I am trying to write up a data system on C++ so that when i enter in 1-10 i can choose what i want to do....but I keep on getting errors...and the people i already entered in at the bottom (the void add_record) i dont think it correct because there are about 5 of them. please help....the errors will be at the bottom

#include <iostream>
#include <string>
#include <fstream>

using namespace std;


void DisplayMenu();
int GetChoice();
bool Confirm();
void ProcessChoice(int);



int main()
{
	int choice;
	bool quit = false;
	do
	{
		DisplayMenu();
		choice = GetChoice();
		if ( choice == 0 )
		{
			if (Confirm())
			quit = true;
		}
		else
			ProcessChoice(choice);

	}while (!quit);

	return 0;
}

void DisplayMenu()
{
	cout << "1) Enter new patient\n";
	cout << "2) List all smokers\n";
	cout << "3) List all Male smokers\n";
	cout << "4) List all Female smokers\n";
	cout << "5) List all with risk factor greater than 5\n";
	cout << "6) List all with risk factor less than 5\n";
	cout << "7) Search by SS number\n";
	cout << "8) List all by an age\n";
	cout << "9) List all with HBP and HFD\n";
	cout << "10) List Counts of Smokers, HFD, and HBP\n";
	cout << "0) Exit\n";
}

int GetChoice()
{
	int choice;
	cout << " Enter a choice ";
	cin >> choice;
	return choice;
}

bool Confirm()
{
	char choice = 'N';
	bool rsp = false;
	bool done = false;
	do
	{
		cout<<" Are you sure to quit (Y/N)? "; …
Ancient Dragon commented: Thanks for using code tags correctly on your first post :) +36