I am beginning to write a program and before I continue writing it I want to get this resolved to make sure that my menu works. I am getting the error
Code:
"error: expected unqualified-id before '{' token"
for lines 71, 78, 85, and 92 (the opening brackets for 4 of the void function definitions). I did a google search but came up with nothing that resolved the issue so here I am. Any help would be much appreciated, and if you could post a modified version of my code that would really help me to understand what you say.
Code:
//*********************************************************************************//*
//*
//*
//*
//*
//*********************************************************************************
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
void menu_options (int& ch);
void display_cat ();
void search_for_cat ();
void cat_most ();
void cat_least ();
int main()
{
int choice;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
do {
menu_options (choice);
switch (choice)
{
case 1: display_cat ();
break;
case 2: search_for_cat ();
break;
case 3: cat_most ();
break;
case 4: cat_least ();
break;
case 5: cout << "Thank you for using my program\n\n";
break;
default: cout << "Please enter a valid choice:\n";
}
} while (choice != 5);
}
void menu_options (int& ch)
{
cout << "1 - display total" << endl
cout << "1 - display total" << endl
<< "2 - search for categories" << endl
<< "3 - category that cost the most" << endl
<< "4 - category that cost the least" << endl
<< "5 - exit" << endl << endl
<< "Enter your choice --> " << endl << endl;
cin >> ch;
}
void display_cat ();
{
cout << "This is category 1 (one)";
}
void search_for_cat ();
{
cout << "This is category 2 (two)";
}
void cat_most ();
{
cout << "This is category 3 (three)";
}
void cat_least ();
{
cout << "This is category 4 (four)";
}