error with program involving classes

EDIT: problem was solved.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47


////////////////////PROJ3.CPP////////////////////////////

int main()
{   
   Department <string> dept1 ("CIS"); // a department
    
    char choice, answer;    // handles input from menu and controls loop
    bool success;
    
    do{ 
	    system("CLS");          // clears the screen
	    cout <<setw(30)<< " Main Menu\n\n\n";   // menu of options to add/remove or clear
	    cout << setw(15)<< " "<< "(1)- (A)dd\n\n"; // data is enterd from within Add
	    cout << setw(15)<< " "<< "(2)- (R)emove \n\n"; // the id to remove is entered in Remove.
	    cout << setw(15)<< " "<< "(3)- (C)lear\n\n\n";
	    cout << setw(35)<< "Enter Choice ";cin >> choice;
	    choice = toupper(choice);
		    switch (choice)
		    {   case '1':
		        case 'A':
		                success = dept1.add();
		                if (success)       // call to the add method
		                    cout <<  "\n\nAdded\n\n";
		                else
		                    cout << "\n\nCould not add\n\n";
		                break;
		        case '2':
		        case 'R':
		                success = dept1.remove();
		                if(success)    // call to the remove method
		                    cout << "\n\nRemoved\n\n";
		                else
		                    cout <<"\n\nCould not Remove\n\n";
		                break;
		        case '3':
		        case 'C':
		                dept1.clear();              // call to the clear method
		                break;
		     }
     cout << "another Operation "; cin >> answer; answer = toupper(answer);
    }     while (answer == 'Y');  

return 0;   
}
Last edited on
> . it says "[Error] no matching function for call to 'Department<std::basic_string<char> >::add()' and that two arguments are expected but none are provided.
What part of TWO and NONE is confusing?

> bool add(const string& newID, const ItemType& newSal);
Here is TWO.

> success = dept1.add();
Here is NONE.

Topic archived. No new replies allowed.