Write a program that inserts parentheses, a space, and a dash into a string of 10 user-entered
Question:
Write a program that inserts parentheses, a space, and a dash into a string of 10 user-entered numbers to format it as a phone number. For example, 5153458912 becomes (515) 345-8912. If the user does not enter exactly 10 digits, display an error message. Continue to accept user input until the user enters 999. Save the file as PhoneNumberFormat.java.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 60% (10 reviews)
import javaxswing public class PhoneNumberFormat public static void mainString a...View the full answer
Answered By
HIMANSHU SINGH ADHIKARI
I AM CURRENT PURSUING MY ENGINEERING DEGREE FROM ACHARYA INSTITUTES,BENGALURU.AS A PART OF TUDENT VOLUNTERSHIP PROGRAM,I WENT TO SIDDHARTHA NAGAR TO TEACH THE STUDENTS OF GOVERNMENT PRIMARY SCHOOL AND TAUGHT THEM MATHS AND SCICENCE SUBJECT.I MADE LEARNING INTERESTING FOR THEM.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Write a program that stores names and telephone numbers in a database. Write another program that stores names and addresses in a database. Modify the programs to use external, conceptual, and...
-
Write a program that stores names and dates of birth in a database. Extend the program so that it stores the format of the data in the database; in other words, create a system catalog. Provide an...
-
Write a program that receives an ASCII code (an integer between 0 and 127) and displays its character. For example, if the user enters 97, the program displays the character a. Here is a sample run:...
-
Capital Inc. has prepared the operating budget for the first quarter of 2015. They forecast sales of $50,000 in January, $60,000 in February, and $70,000 in March. Variable and fixed expenses are as...
-
Prepare a graph for your school's Accounting Club of the Federal income tax rates that apply at taxable income levels up to $200,000 for each filing status.
-
Pittsburgh-Walsh Company, Inc. (PWC), manufactures lighting fixtures and electronic timing devices. The lighting fixtures division assembles units for the upscale and mid-range markets. The trend in...
-
Fill in the Blank. The presence of unbalanced mass in a rotating disc causes ____________ .
-
Jenna Lindsay works at College of Boston and is paid $40 per hour for a 40-hour workweek and time-and-a-half for hours above 40. Requirements 1. Compute Lindsays gross pay for working 54 hours during...
-
Identify two strategies that can be used to resolve issues between team members. Briefly explain how each strategy can be used to resolve issues.
-
Waldon Corporation's balance sheet shows that the company has $600,000 invested in operating assets. During 2010, Waldon earned $120,000 on $960,000 of sales. The company's desired return on...
-
Write an application that accepts a word from a user and converts it to Pig Latin. If a word starts with a consonant, the Pig Latin version removes all consonants from the beginning of the word and...
-
Write an application that determines whether a phrase entered by the user is a palindrome. A palindrome is a phrase that reads the same backward and forward without regarding capitalization or...
-
On October 1, 2014, Pacer Corp. acquired all of Sunny Corp.s outstanding stock for cash. The fair value of Sunnys net assets was less than the purchase price but more than the net carrying amount....
-
An 8 g sample of sulfur is introduced into a calorimeter containing 400g water. When the S sample is burned completely to form SO2 (g), the water temp is observed to increase by 66 C. Determine the...
-
Premier Bank and Trust is considering giving Waterway Company a loan. Before doing so, they decide that further discussions with Waterway's accountant may be desirable. One area of particular concern...
-
Oriole Company sells a snowboard, WhiteOut, that is popular with snowboard enthusiasts. Presented below is information relating to Oriole Company's purchases of White Out snowboards during September....
-
Why are used goods, financial assets, and government assets not counted as GDP expenditures? A few years ago BP experienced a well explosion in the Gulf of Mexico that resulted in massive amounts of...
-
Z plc has found that it can estimate future sales using time series analysis and regression techniques. The following trend equation has been derived: y = 25,000 + 6,500x where: y is the total sales...
-
In the U.S. federal and state tax is based on taxable net income, excluding not-for-profit entities. What are the arguments for basing all organizational taxes on cash and cash equivalent receipts...
-
TRUE-FALSE QUESTIONS 1. In terms of preliminary analytical procedures, assume that the company has introduced a new product with a low price point and significant customer demand. The auditor would...
-
Building Block Day Care Center charges varying weekly rates depending on the age of the child and the number of days per week the child attends, as shown in Table 8-5. Develop the logic for a program...
-
Building Block Day Care Center charges varying weekly rates depending on the age of the child and the number of days per week the child attends, as shown in Table 8-5. Develop the logic for a program...
-
Executive Training School offers typing classes. Each final exam evaluates a students typing speed and the number of typing errors made. Develop the logic for a program that produces a summary table...
-
How does the perception of organizational justice affect employee motivation and job satisfaction, and what can organizations do to promote a sense of fairness and equity ?
-
What factors contribute to the formation of high-performance teams, and how can organizations cultivate and sustain these dynamics over time ?
-
The standard 2-pass spur gear train with the # of teeth on each gear as shown is driven is driven at 1000 RPM from shaft 2 with a torque of 25 in-lb. All the gears in the set have a diametral pitch...
Study smarter with the SolutionInn App