I'm quite stuck with this C++ question, I would greatly appreciate the help!
Many companies use telephone number like 888- COM - CAST so the number is easier for their customer to remember. On a standard telephone, the alphabetic letters are mapped to numbers in the following fashion.
A, B, and C = 2
D, E, and F = 3
G, H, and I = 4
J , K , and L = 5
M, N, and O = 6
P, Q, R and S = 7
T, U, and V = 8
W, X, Y, and Z = 9
Write an application that asks the user to enter a 10 – character telephone number in the format xxx-xxx-xxxx. The application should
display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. For
example, if the user enters 888-COM-CAST the application should display 555-266-2278.
#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
int main(){
//delaring variable to store input of user
string Num;
cout<<"Please enter string to convert number";
cin>>Num;
for(int i=0;i<=Num.length();i++){
int j=1;
string r = Num.substr(i,j);
if(r=="A" || r=="B" || r=="C" ){
Num.replace(i,j, "2");
}else if(r=="D" || r=="E" || r=="F"){
Num.replace(i,j, "3");
}else if(r=="G" || r=="H" || r=="I"){
Num.replace(i,j, "4");
}else if(r=="J" || r=="K" || r=="L"){
Num.replace(i,j, "5");
}else if(r=="M" || r=="N" || r=="O"){
Num.replace(i,j, "6");
}else if(r=="P" || r=="Q" || r=="R" || r=="S"){
Num.replace(i,j, "7");
}else if(r=="T" || r=="U" || r=="V"){
Num.replace(i,j, "8");
}else if(r=="W" || r=="X" || r=="Y" || r=="Z"){
Num.replace(i, j, "9");
}
else{
}
j=j+1;
}
cout<<"Phone Number:"<<Num;
}
I'm quite stuck with this C++ question, I would greatly appreciate the help! Many companies use...
Help with programming in Raptor: Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers to remember. On a standard telephone, the alphabetic letters are mapped to numbers in the following fashion: A, B, and C = 2 D, E, and F = 3 G, H, and I = 4 J, K, and L = 5 M, N, and O = 6 P, Q, R, and S = 7 T, U, and V = 8...
This is Python The program should accept input from the user as either 7-digit phone number or 10-digit. If the user enters 7 characters, the program should automatically add "512" to the beginning of the phone number as the default area code. Dash (hyphen) characters do not count in input character count, but must not be random. If the user enters dashes the total character count must not exceed 12. The program should not crash if the user enters invalid...
This is for a C# program. I would greatly appreciate any help! Thank you:) For this assignment you're going to create a console application called A02PBallGenerator. This app is going to mimic a quick pick program in a lotto terminal. When the user runs your app you're going to select the numbers for them. Then you'll ask them if they'd like another set of numbers. Y for yes and N for No Use a do while loop so that if...