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.
-
Specifications for the computer upgrades in Problem 4 are 78 minutes and 81 minutes. Based on the data given in the problem, are the specifications being met? Estimate the percentage of process...
-
Bank of America lent $100,000 to Christine Kleuters on a 90-day, 8% note. Record the following transactions for Bank of America (explanations are not required): 1. Lending the money on June 12. 2....
-
Change to LIFO Retail Diderot Stores Inc., which uses the conventional retail inventory method, wishes to change to the LIFO retail method beginning with the accounting year ending December 31,...
-
Waterway Company purchased machinery on January 1, 2025, for $95,200. The machinery is estimated to have a salvage value of $9.520 after a useful life of 8 years. (a) Your Answer Correct Answer *...
-
The figure below shows a hot gas stream at 500 C being cooled to 300 C by transferring heat to the liquid water that enters at 20 C and exits at 218 C. Assume that the heat exchanger is insulated....
-
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...
-
The model using 12 squared and interaction variables has the smallest s. However, if we desire a somewhat simpler model, note that s does not increase substantially until we move from a model having...
-
On April 31, 2019, Y acquired for $655000 cash in exchange of 70% of the outstanding common stocks of X when X's balance sheet showed net assets of $1000000 at the FMV. The business combination costs...
-
A buyer places an order for 10 dozen pen sets. The list pre 560.00 each, and disc for 3re 2/10 shipped via truck 25%, 20% and are greet chargesipped 128.60 and were prepaid by the factory lon sets...
-
What is wrong with the following code segment if the numbers from 1 to 10 are meant to be output? int num = 0; while (num >10){ num = num + 1; System.out.println(num); }
-
A proposed square footing carrying a total load of 500 kips is to be constructed on a uniform thick deposit of dense cohesionless soil. The soil's unit weight is 135 pcf, and its angle of internal...
-
Do you think the stock value is largely determined by the near future dividends, or the long term events? Does a one-time increase in dividend significantly increase the stock value?
-
A submarine can be treated as an ellipsoid with a diameter of 5 m and a length of 25 m. Determine the power required for this submarine to cruise horizontally and steadily at 40 km/h in seawater...
-
One of the significant and relevant accounts for this cycle is equipment. For this account, what would typically be the most relevant assertions for the auditor to consider? Why is it important for...
-
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...
-
XYZ Company's 2020 financial statements have the following distributions of the first digits. Digit 1 Frequency 18 15 2345678 5. 0 5 10 6 7 14 8 7 93 What is the Kolmogorov-Smirnov test statistic for...
-
4. The company has provided you the following information with regard to its stock investment acquisition in its initial year of operations: ABC Corp. DEF Inc. H&M Co. Number of Shares acquired 2,000...
-
Question 2 Alan Li, a Singaporean, is employed by Good Luck Ltd (GLL), a company carrying on business in Hong Kong, as a brand manager. He negotiated the terms of his employment with GLL through...
Study smarter with the SolutionInn App