Please Help Me! I cannot figure out what to do. I get an error that I don't understand. I posted my code and error below:
#include <iostream>
#include <string>
#include <iomanip>
#include <cctype>
using namespace std;
//prototypes
int read_dials(char &d1, char &d2, char &d3, char &d4, char &d5, char &d6, char &d7, char &d8);
int todigits(char &d);
void acknowledge_call(char d1, char d2, char d3, char d4, char d5, char d6, char d7, char d8);
int main()
{
int read_dials(char &d);
char returnValue = 0;
while (returnValue != -5)
{
switch (returnValue)
{
case -1: cout << "ERROR - An invalid character was entered." << endl; break;
case -2: cout << "ERROR - Phone number cannot begin with 0." << endl; break;
case -3: cout << "ERROR - Phone number cannot begin with 555." << endl; break;
case -4: cout << "ERROR - Hyphen is not in the correct position." << endl; break;
[COLOR="red"]default: acknowledge_call();[/COLOR] }
}
return 0;
}
int read_dials(char &d1, char &d2, char &d3, char &d4, char &d5, char &d6, char &d7, char &d8)
{
cout << "\nEnter a phone number (Q to quit):";
cin >> d1;
if (d1 == 'Q')
return -5;
cin >> d2 >> d3 >> d4 >> d5 >> d6 >> d7 >> d8;
// call ToDigits function
if (todigits(d1) == -1)
return -1;
if (todigits(d2) == -1)
return -1;
if (todigits(d3) == -1)
return -1;
if (todigits(d5) == -1)
return -1;
if (todigits(d6) == -1)
return -1;
if (todigits(d7) == -1)
return -1;
if (todigits(d8) == -1)
return -1;
if (d4 != '-')
return -4;
if (d1 == 0)
return -2;
if (d1 && d2 && d3 == 5)
return -3;
else
return 0;
}
int todigits(char &d)
{
toupper(d);
switch (d)
{
case 'A':
case 'B':
case 'C': d = '2'; return 0; break;
case '1': return 0; break;
case 'D':
case 'E':
case 'F': d = '3'; return 0; break;
case '2': return 0; break;
case 'G':
case 'H':
case 'I': d = '4'; return 0; break;
case '3': return 0; break;
case 'J':
case 'K':
case 'L': d = '5'; return 0; break;
case '4': return 0; break;
case 'M':
case 'N':
case 'O': d = '6'; return 0; break;
case '5': return 0; break;
case 'P':
case 'Q':
case 'R':
case 'S': d = '7'; return 0; break;
case '6': return 0; break;
case 'T':
case 'U':
case 'V': d = '8'; return 0; break;
case '7': return 0; break;
case 'W':
case 'X':
case 'Y':
case 'Z': d = '9'; return 0; break;
case '8': return 0; break;
}
}
void acknowledge_call(char d1, char d2, char d3, char d4, char d5, char d6, char d7, char d8)
{
cout << "Phone Number Dialed:" << d1 << d2 << d3 << d4 << d5 << d6 << d7 << d8 << endl;
}
Here the error message:
1>.\Lab4.cpp(28) : error C2660: 'acknowledge_call' : function does not take 0 arguments
The problem area is highlighted in red