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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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