Reference no: EM13940717
Implement a Java program that reads phone numbers, and for each phone number, it displays the phone number's three components - country code, area code, and local number.
Assume that the user enters each phone number as a series of digits and dashes, such that there are three groups of digits and two dashes separating the three groups. For example, 1-816-7412000. The first digit group (1 in the example) is the country code, the second digit group (816 in the example) is the area code, and the third digit group (7412000 in the example) is the local phone number.
Do not assume that the number of digits in a particular digit group is fixed. For example, the country code for the United States requires one digit (1) and the country code for China requires two digits (86).
A sample session would look like following.
PHONE NUMBER DISSECTOR
Enter a phone number in the form cc-area-local,
where cc = country code digits, area = area code digits,
and local = local phone digits.
Or enter q to quit:
1-816-7412000
country code = 1
area code = 816
local phone number = 7412000
Enter a phone number in the form cc-area-local,
where cc = country code digits, area = area code digits,
and local = local phone digits.
Or enter q to quit:
86-131-12345678
country code = 86
area code = 131
local phone number = 12345678
Enter a phone number in the form cc-area-local,
where cc = country code digits, area = area code digits,
and local = local phone digits.
Or enter q to quit:
Q
Press any key to continue . . .
What are the classifications of operating assets
: What are the classifications of operating assets? How do they differ from one another? How does the cost concept affect accounting for operating assets? Under this concept, what is included in the cost of a fixed asset?
|
Business sustainability report for gorilla health bars
: Write a 1, 000-word Business Sustainability Report for Gorilla Health Bars CEO Janet Jones, in which you make specific recommendations, based on your research, about how the company can become more sustainable.
|
How would your resolution be enforced
: How would your resolution be enforced? In other words, what if Johnson doesn't live up to his agreement? Why you think your resolution is a better alternative for all concerned than a traditional punishment?
|
Calculate the rate per square foot for warehousing
: Calculate the rate per square foot for Warehousing. Calculate the traceable fixed costs for each division and for each product in the Clothing division
|
Implement a java program that reads phone numbers
: Implement a Java program that reads phone numbers, and for each phone number, it displays the phone number's three components - country code, area code, and local number.
|
Is banishment more humane than corporal punishment
: Why might a society choose banishment as a way of dealing with criminals rather than corporal or capital punishment? Is banishment more or less humane than corporal or capital punishment? Explain your answer
|
Explain the purpose of tqm
: Define and explain the purpose of TQM. What elements within a manufacturing environment need to be reduced or eliminated as part of a Lean Manufacturing focus?
|
Risk management program for an organisation
: This project entails you planning, conducting and evaluating a risk management program for an organisation. For the purpose of this project, the term organisation can include a small business, work team or division in a large organisation, sportin..
|
What fundamental assumptions of career criminal programs
: What are some of the fundamental assumptions of career criminal programs? What limitations might these assumptions present in our efforts to identify and punish career criminals?
|