联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2021-04-04 02:34

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.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp