Write a program that accepts a phone number of the form +1(xxx)-XXX-XXXX where x is a...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/questions/2024/03/6603d1ccaaef1_1711529857004.jpg)
Transcribed Image Text:
Write a program that accepts a phone number of the form +1(xxx)-XXX-XXXX where x is a digit, and displays the sum of all digits in the phone number. Example (user's input in red, output in blue) Enter a US phone number: +1(971)-345-6729 The sum of all digits in the phone number is: 53 The product of digits in the phone number is: 2857680 Write a program that accepts a phone number of the form +1(xxx)-XXX-XXXX where x is a digit, and displays the sum of all digits in the phone number. Example (user's input in red, output in blue) Enter a US phone number: +1(971)-345-6729 The sum of all digits in the phone number is: 53 The product of digits in the phone number is: 2857680
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
The 2020 financial statements of Outdoor Waterworks Inc. follow: Outdoor Waterworks Inc. Income Statement For Year Ended December 31, 2020 Net sales Cost of goods sold: ped $1,076,000 Ook int ences...
-
Microkernel operating systems aim to address perceived modularity and reliability issues in traditional "monolithic" operating systems. (i) Describe the typical architecture of a microkernel...
-
Miller Company manufactures a line of lightweight running shoes. CEO Richard Miller estimated that the company would incur $7,000,000 in manufacturing overhead during the coming year. Additionally,...
-
A Ltd acquired a 60% shareholding interest in B Ltd in 20x4. B Ltd acquired a 30% shareholding interest in C Ltd in 20x5. A Ltd acquired a 30% shareholding interest in C Ltd in 20x6. For the year...
-
Two metal spheres of radius 5.0 cm carry net charges of + 1.0 C and + 0.2 C. (a) What (approximately) is the magnitude of the electrical repulsion on either sphere when their centers are 1.00 m...
-
In this exercise we explore nonlinear effects in ion-acoustic waves (Ex. 21.5), and show that they give rise to solitons that obey the same KdV equation as governs solitonic water waves. This version...
-
Prepare a manufacturing statement and explain its purpose and links to financial statements
-
Refer to the Auditing in Practice feature What Was He Thinking? An Example of Poor Professional Judgment and Low Audit Quality. a. Briefly explain the common themes indicating poor professional...
-
BE9.8 (LO 3) Compute interest and find the maturity date for the following notes. Date of Note Principal Interest Rate (%) Terms a. June 10 $80,000 6% 60 days b. July 14 $64,000 7% 90 days c. April...
-
For this exercise, we use JTRAIN.RAW to determine the effect of the job training grant on hours of job training per employee. The basic model for the three years is hrsempit = (0 + (1td88t + (2d89, +...
-
Determining Market-Based and Negotiated Transfer Prices Carreker, Inc., has a number of divisions, including the Alamosa Division, producer of surgical blades, and the Tavaris Division, a...
-
Case # 4 Joseph Joseph, a 19-year-old African American college freshman. Yesterday he spent the afternoon drinking beer and taking shots of vodka with his fraternity brothers. After 6 glasses of beer...
-
1. Kaldor facts [50 points] Kaldor (1961) documented a set of stylized facts on the growth process of industrialized countries. We discussed these facts in lecture 2. Explain if and how the...
-
County has the Investment Activities recorded in its general fund: Tesla Stock: Cost $100, Fair Value on Jan 1x1: $200; Fair Value on Dec 31x2: $300 DJT Stock: Cost: $100; Fair Value on Jan 1x1:...
-
Pets World is a retailer of a popular blend of organic dog food produced by Natural Pets Company. On average, Pets World sells 600 cans per week. The wholesale price that Natural Pets Company charges...
-
Out Supply-Chaining the King of Supply Chainers, How easy (or hard) would it be for rivals like Walmart or Carrefour to adopt Tesco's data management techniques? (Please provide reference...
-
Billy Bob just purchased an investment that will pay him $10,000, $20,000 and $12,000 over the next three years, respectively. If Billy Bob expects to earn 12% compounded annually, how much did he...
-
You continue to work in the corporate office for a nationwide convenience store franchise that operates nearly 10,000 stores. The per- store daily customer count (i.e., the mean number of customers...
-
Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating-point number for the temperature and a character for the scale: either 'C' for Celsius...
-
Write statements that can be used in a Java program to read your age, as entered at the keyboard, and display it on the screen.
-
Sometimes we would like a class that has just a single unique instance. Create a class Merlin that has one attribute, theWizard, which is static and of type Merlin. The class has only one constructor...
-
P 11-3 Computations (parent-company and entity theories) Pop Corporation paid $1,190,000 cash for 70 percent of the outstanding voting stock of Son Corporation on January 2, 2017, when Son...
-
E 11-10 Corporate joint venture investment income Mill Pte. Ltd. is a venture corporation that consists of investor-venturers with 40 percent, 25 percent, 20 percent, and 15 percent interest, who...
-
4. Cite the conditions under which consolidated net income under parent-company theory would equal income to controlling stockholders under entity theory.
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App