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

Discuss how does the free market economies stimulate

Discuss how does the free market economies stimulate greater economic growth, whereas state-directed economies stifle growth. Please mention references.

Corporate culture can be a source of strength for a company

Corporate culture can be a source of strength for a company. Discuss the ways in which culture is a strength. Please provide an example of an organization whose culture is a source of strength.

Discuss the advantages of having and interacting in a

Discuss the advantages of having and interacting in a diverse workplace. Consider the wide range of ideas and perspectives that a range of team members bring to a team, that are of differing ages, ethnic backgrounds and ...

Applying the concept of collective sense-making processes

Applying the concept of collective sense-making processes, analyze the Blue vs. Gray Case Study. What are the important sense-making processes that made the implementation of change challenging and difficult? What could ...

Puneet is a member of a student project team in her

Puneet is a member of a student project team in her Organizational Behavior class. In order to assess the extent to which her team is cohesive, she should ask which of these questions? a. How well do members of her group ...

Would it help if a non-profit that aims to help the less

Would it help if a non-profit that aims to help the less fortunate lobbied with the United Nations and other international organizations to make the governments in some of the countries to spend a certain percentage of t ...

A project requires an initial investment of 800 and grants

A project requires an initial investment of $800 and grants cash flows of $100 at the end of year 1, $200 at the end of year 2, $300 at the end of year 3 and $400 at the end of year 4. At a discount rate of 20 percent, i ...

What are your thoughts on conducing a panel interview

What are your thoughts on conducing a panel interview versus 1 x 1? Are there positions where a panel is more valuable than a multiple hurdle 1 x 1 system?

Explaining how professional etiquette can impact

Explaining how professional etiquette can impact professional relationships. Consistently displaying proper etiquette is a reflection of one's organization and can build or destroy business relationships. explain the imp ...

Discuss three specific advantages and disadvantages

Discuss three specific advantages and disadvantages regarding the division of labor?

  • 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