Please help. I really think I'm close to getting this. No I'm just banging my head against a wall. I have to replace a nested if statement with a switch statement. The loop should continue until Z or z is entered. I can't figure out what I'm doing wrong.
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include <cmath>
using namespace std;
char letter;
int main()
{
do {
cout << "Enter a single letter, and I will tell you what that corresponding digit" << endl;
cout << "is on the telephone keypad." << endl;
cin >> letter;
switch (letter)
{
case 'A':;
case 'a':;
case 'B':;
case 'b':;
case 'C':;
case 'c':;
cout << "2" << endl;
break;
case 'D':;
case 'd':;
case 'E':;
case 'e':;
case 'F':;
case 'f':;
cout << "3" << endl;
break;
case 'G':;
case 'g':;
case 'H':;
case 'h':;
case 'I':;
case 'i':;
cout << "4" << endl;
break;
case 'J':;
case 'j':;
case 'K':;
case 'k':;
case 'L':;
case 'l':;
cout << "5" << endl;
break;
case 'M':;
case 'm':;
case 'N':;
case 'n':;
case 'O':;
case 'o':;
cout << "6" << endl;
break;
case 'P':;
case 'p':;
case 'Q':;
case 'q':;
case 'R':;
case 'r':;
case 'S':;
case 's':;
cout << "7" << endl;
break;
case 'T':;
case 't':;
case 'U':;
case 'u':;
case 'V':;
case 'v':;
cout << "8" << endl;
break;
case 'W':;
case 'w':;
case 'X':;
case 'x':;
case 'Y':;
case 'y':;
cout << "9" << endl;
break;
case '&':;
cout << "There is no digit on the telephone keypad that corresponds to &." << endl;
break;
}
} while (letter != 'Z' || letter != 'z');
cout << "Enter a single letter, and I will tell you what that corresponding digit" << endl;
cout << "is on the telephone keypad." << endl;
cin >> letter;
break;
{
}