Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

Input Data:

  • Enter a phone number (set up a string-type object for the phone number)
  • inputting is done at the keyboard.
  • examples:
  • (703) 323-3000
  • 011-44-20-7797-782
  • NOTE 1: The input data may include non-digit characters, such as parentheses, dashes, etc.
  • NOTE 2: Your program should handle phone numbers of any length.
  • NOTE 3: Your program should skip non-digit characters and process only characters '0' through '9'.

Output Data:

  • Display the phone number, using a format like the following:
  • Example 1:
  • The phone number you entered is 703-323-3000.
  • Display the content of the array that holds the count for each digit in the string. Use a format similar to the following:
Digit 0 showed up 4 times.
Digit 1 showed up 0 times.
Digit 2 showed up 1 times.
Digit 3 showed up 4 times.
Digit 4 showed up 0 times.
Digit 5 showed up 0 times.
Digit 6 showed up 0 times.
Digit 7 showed up 1 times.
Digit 8 showed up 0 times.
Digit 9 showed up 0 times.
  • Example 2:The phone number you entered is 011-44-20-7797-782.
  • Display the content of the array that holds the count for each digit in the string. Use a format similar to the following:
Digit 0 showed up 2 times.
Digit 1 showed up 2 times.
Digit 2 showed up 2 times.
Digit 3 showed up 0 times.
Digit 4 showed up 2 times.
Digit 5 showed up 0 times.
Digit 6 showed up 0 times.
Digit 7 showed up 4 times.
Digit 8 showed up 1 times.
Digit 9 showed up 1 times.

Processing:

  • Here's an algorithm to get this done:
set up an integer array of size 10 
initialize each element to zero 
input string of phone number 
set SIZE = length of the string 
set up a loop to iterate SIZE times 
 get next character 
 if character is numeric then update array appropriately 
 (for example: if the character is '7' then increment array[7] by 1. 
 } 
  • Display BOTH of the following using appropriate messages (see above examples):   the original phone number

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92569867
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Business Management

Max has a utility function ux y 16x - 2x 2 4y the prices

Max has a utility function u(x, y) = 16x - 2x 2 + 4y. The prices of x and y are both px and py. Max has an income m. How much of each good will he demand? Find the algebraic expression for the marginal rate of substituti ...

Can you tell me the differences in planning and organizing

Can you tell me the differences in planning and organizing in the four functions of business model created by Henry Fayol?

Most calls made at random by sample surveys dont succeed in

Most calls made at random by sample surveys don't succeed in talking with a person. Of calls to New York City, only one-twelfth succeed. A survey calls 500 randomly selected numbers in New York City. X is the number of t ...

Assume that the box contains 12 balls 4 red 4 green and 4

Assume that the box contains 12 balls: 4 red, 4 green, and 4 blue. Two balls are drawn at random, one after the other without replacement. What is the probability that the first ball was blue, given that the second was r ...

Please respondwhat are some other ways to troubleshoot

PLEASE RESPOND What are some other ways to troubleshoot reduced speed or latency? Or to find out what is using all the bandwidth? Perhaps might incorporate parts of this into own three issues.

What should be done to maintain optimum stock levels and

What should be done to maintain optimum stock levels and why is it important to keep accurate and up-to-date records of stock?

According to some experts the sort of behavior recorded

According to some experts, the sort of behavior recorded here is more prevalent in the business world than in the rest of society. Assuming that's true, why do you suppose that's the case.

Example of a company using forecasting for operations

Example of a company using forecasting for operations management in supply chain management?

What are the prospects of a no deal on brexit and what are

What are the prospects of a "no deal" on BREXIT, and what are the implications for European business?

What is dbms explain in detailimportance of dbms -explain

What is DBMS? Explain in detail Importance of DBMS -Explain in detail and provide examples Types of DBMS Explain in detail and providing examples -ALL Key words : Hierarchical, Network, Relational, Object Oriented Relati ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As