anonymous
  • anonymous
please can anyone help me with a computer science (c++) problem.......Write a program that reads from the user a letter, and prints out the digit value corresponding to this letter based on the encoding on a mobile phone's keypad. For example, for a, b, or c, the program would print the digit 1. If the letter entered is not one of the letters of the alphabet, print a value of -1. Use a switch statement
Mathematics
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
bahrom7893
  • bahrom7893
easyyy....... but i rly don't feel like doing this hahah
anonymous
  • anonymous
haha :0
anonymous
  • anonymous
:)

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
i'm still new to the c++ thing so i really need help
bahrom7893
  • bahrom7893
just do: cout << "Please enter a letter"; cin >> a; then switch case.. like case a, b, or c display this.. very simple hold on..
anonymous
  • anonymous
tyt
bahrom7893
  • bahrom7893
writing in the compiler.. give me a few mins
anonymous
  • anonymous
its ok take your time, really appreciate your help
bahrom7893
  • bahrom7893
wait what corresponds to what again? like isn't abc on 2, so shouldn't it be 2, not 1?
anonymous
  • anonymous
oh you're right..
anonymous
  • anonymous
it's 2 then
bahrom7893
  • bahrom7893
#include using namespace std; int main() { char letter; cout << "Please enter a letter: "; cin >> letter; switch (letter) { case 'a': cout << "\n2\n" << endl; break; case 'b': cout << "\n2\n" << endl; break; case 'c': cout << "\n2\n" << endl; break; case 'd': cout << "\n3\n" << endl; break; case 'e': cout << "\n3\n" << endl; break; case 'f': cout << "\n3\n" << endl; break; case 'g': cout << "\n4\n" << endl; break; case 'h': cout << "\n4\n" << endl; break; case 'i': cout << "\n4\n" << endl; break; case 'j': cout << "\n5\n" << endl; break; case 'k': cout << "\n5\n" << endl; break; case 'l': cout << "\n5\n" << endl; break; case 'm': cout << "\n6\n" << endl; break; case 'n': cout << "\n6\n" << endl; break; case 'o': cout << "\n6\n" << endl; break; case 'p': cout << "\n7\n" << endl; break; case 'q': cout << "\n7\n" << endl; break; case 'r': cout << "\n7\n" << endl; break; case 's': cout << "\n7\n" << endl; break; case 't': cout << "\n8\n" << endl; break; case 'u': cout << "\n8\n" << endl; break; case 'v': cout << "\n8\n" << endl; break; case 'w': cout << "\n9\n" << endl; break; case 'x': cout << "\n9\n" << endl; break; case 'y': cout << "\n9\n" << endl; break; case 'z': cout << "\n9\n" << endl; break; default: cout << "\n-1\n" << endl; } system("pause"); return 0; }
anonymous
  • anonymous
it worked, you're the best thank you so much , really appreciate what've done,and sorry it took a lot of time
bahrom7893
  • bahrom7893
nah it wasn't that hard hahah np
anonymous
  • anonymous
thanks :)

Looking for something else?

Not the answer you are looking for? Search for more explanations.