Implement a java program that reads phone numbers

Assignment Help JAVA Programming
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 . . .

Reference no: EM13940717

Questions Cloud

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?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Modify the java application using java netbeans ide

Modify the Java application using Java NetBeans IDE to meet these additional and changed business requirements. The application will now compare the total annual compensation of at least two salespersons.

  Implement the client and server components

The basic requirements of this assignment are to implement the client and server components as discussed above. The basic protocol of the system is described below: The operations of the client are: SEND_SERVER_MESG: send a basic text message to th..

  Eclipse or netbeans environments

As recommendation, you can try to use Eclipse or NetBeans environments that are used also for other courses as: Introduction in Java programming and Intermediate programming.

  Graphics program that draws 12 strings

Write a graphics program that draws 12 strings, one each for the 12 standard colors, besides Color.WHITE, each in its own color. Provide a class ColorNameViewer and a class ColorNameComponent.

  You need to find out the average score how many scores are

suppose that you have an array of baseball scores type integer called scores. the values in the array are ordered from

  Write a jsf application that reports the values

Write a JSF application that reports the values of the following system properties of the web server

  Writing a program that computes the average salary

The first programming project involves writing a program that computes the average salary for a collection of employees of different types. This program consists of four classes

  Prepare a program that constructs a binary tree

Write your own implementation of primitive operations and use self-referential classes in your implementation.

  Mean and standard deviation write a program that reads a

mean and standard deviation. write a program that reads a set of floating-point data values from the input. when the

  Prepare a java program to random pick

The user and computer will each randomly pick one and common rules of winning apply. The game ends when the user and computer pick the same item.

  Write a java program to read sequences of integers from a

write a java program to read sequences of integers from a text file build a binary search tree for each sequence by

  Chat monitoring system

The name of the project is chat monitoring system. in the file you will see the screenshot diagram 2A are my design, i want it to be upgrade, to look professional like the diagram 2B. please java, netbeans and GUI. please can I have only the client s..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd