I wrote a program that asks a user to input letters to be converted into telephone digits for a phone number. I got it to work with a switch case in a loop but i want to ask the user if they want to go again. if they do, reset counter to 0 and go back into the loop after they are prompted to enter more letters for a phone number.
I know i need to use a nested loop but I'm just stuck and can't figure out how to rearrange this so i can get what i want...i feel stupid :(
I'm sorry if it seems like I'm just asking for an answer here, but i need some more helpful hints, something just isn't clicking in my head...
I am aware that some of it isn't doing anything and that's just because I'm still in the process of writing it
#include <iostream>
#include <string>
usingnamespace std;
void convertTelephone() // Put your conversion routine in this function
{
cout << "This will convert a telephone number once it's written.\n";
}
int main()
{
char goAgain = 'y';
while ( goAgain == 'y' || goAgain == 'Y' )
{
convertTelephone(); // Call function here
cout << "Would you like to go again? (Y/N): ";
cin >> goAgain;
}
}