Sale!

CSC150 Assignment 10 solved

$30.00 $18.00

Original Work ?

Download Details:

  • Name: AssignmentTen-id6s0i.zip
  • Type: zip
  • Size: 72.10 KB

Category: Tag: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

Implement a 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. See the sample session for details.

You may assume that the user enters each phone number at a series of digits and dashes, such as there are three groups of digits and the dashes separating the three groups. For example, 1–816–741,000. (The first digit group (1 in the example) is the country code, the second digit group (816 in the example) is the one, so the end the third digit group (741,000) in the example is the local phone number.

You may not assume that the number of digits in a particular digit group is fixed. For example, the country code (the “the Local States requires one digit (1) and the country code for China requires two digits (0)).

Your program should repeatedly prompt the user for phone numbers until the user enters “q”. The program terminates when the user enters the “q”.

The program should perform input validation for the user’s phone numbers (only numbers are acceptable).

Do not forget to use a proper style is your VariableNameChecker.java file (including comments) and a privileges section at the top of the file.


Sample session

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–741,000

country code = 1
area code = 816
local phone number = 741,000

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–12145678

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.
88–125–12345555

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