首页 > > 详细

辅导data程序语言、辅导Java编程、Java程序调试解析R语言编程|辅导留学生Processing

The Alphabetic Telephone Number Translator
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
•W, X, Y, and Z = 9

For this question, you must write a Java program that performs the following tasks:
a)Displays a menu such as the one shown below (Use JOptionPane instead of a terminal window):

b)Retrieves the number that the user provides, such as 555-GET-FOOD.
c)Checks if the input is valid, i.e., it should have 12 characters that includes the dash symbols. Your program shall display the following message If the input is not valid and repeats steps (a) through (c) again. If the input is valid, it proceeds to item (d) below.
d)Your program shall replace the letters in the provided number, such as from 555-GET-FOOD to 555-438-3663.
e)Your program shall display both, the original number and the translated number as shown below.


f)After the user press the OK button, the program loops over to step (a) again.
g)If the user selects the option to quit, then the program is terminated.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!