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.:- M92571862
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Business Management

What are the ways provider tries to make a service tangible

What are the ways provider tries to make a service tangible to the consumer? How does it try to differentiate its service from those of its competitor?

Bullhow could advertising be a barrier to entry could

• How could advertising be a barrier to entry? Could advertising reduce barriers to entry for a new product? • Presumably drug companies are trying to differentiate their products from the competition. Will consumers be ...

What are the national quality control techniques what are

What are the national quality control techniques? What are national quality control procedures?

Can you please explain the following strategies overall

Can you please explain the following strategies: overall cost leadership, differentiation, and focus, and share an example of these strategies?

If there are constant rumors that a business is in a

if there are constant rumors that a business is in a financial crisis, employees might lose internal motivation, what position of maslow hierarchy is this?

A us owned automobile factory uses 50 million worth of

A US owned automobile factory uses $50 million worth of materials produced in the US and $10 million worth of material purchased from foreign countries to produce $100 million worth of automobiles. $70 million worth of a ...

Learning outcomediscuss the social and cultural aspects of

Learning outcome Discuss the social and cultural aspects of communication within teams. Social relationships - the effect of gender Word count: 800 words excluding your referencing. Write an essay arguing "for" or "again ...

Er database modeling questionemployees have an id name

ER database modeling question: Employees have an id, name, department and datejoined. A manager who is also an employee is managing a department and can be a manager of several employees in that department. Ignore Depart ...

Mike lives next door to a retired old man who spends his

Mike lives next door to a retired old man who spends his winters in Florida. While he is away, Mike shovels the old man's sidewalk and steps for $20 per snowfall. This agreement has gone well for the past two years so th ...

What is the strategy adopted by breadtalk are they

What is the strategy adopted by BreadTalk? Are they succeeding or failing? Why?

  • 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