Enter a phone number

Assignment Help Business Management
Reference no: EM131763179

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

Reference no: EM131763179

Questions Cloud

Provide a brief summary of the disaster : Provide a brief summary of the disaster and explain the common public health risks that occurred as well as potential long-term health risks the victims facing
Write an essay regarding insurance sector in oman : Write an essay regarding insurance sector in Oman including the below points:
Record with the two tables you implemented : Extend your PHP application to read and compose a record with the two tables you implemented in MySQL, and dynamically display the results.
Successfully fending off four other bidding firms : Consider the following scenario: A firm acquires a strategically related target after successfully fending off four other bidding firms
Enter a phone number : Enter a phone number (set up a string-type object for the phone number) inputting is done at the keyboard.
Discuss how they may affect private security personnel : Define and discuss the differences between civil and criminal law. What is a tort?
Prepare journal entries to record all investment purchases : Surabaya Company made a stock investment transaction for trading in 2015 as follows: January 1, 2015, boughy 10,000 ordinary shares of A Company at $36/share.
Describe the traditional principles of vaccine preparation : Describe the traditional principles of vaccine preparation. List the newer strategies being used for vaccine preparation
What is the noerr-pennington doctrine : What is the Noerr-Pennington doctrine?What are some of the reasons why administrative agencies are needed?

Reviews

Write a Review

Business Management Questions & Answers

  Think about a current occasion when you or somebody working

Think about a current occasion when you or somebody working close to you have attempted to introduce as well as manage a change in your part of the organization

  Develop a regression model to predict the total number

State the linear equation - Explain the overall statistical significance of the model - Develop a regression model to predict the total number of victories based on the payroll.

  Using balance sheets compute working capital

Applied Managerial Finance FINC615- 1530A-02 - Using balance sheets, compute working capital. Provide your analysis regarding working capital.

  What policies and procedures does whole foods enact

What policies and procedures does Whole Foods enact that allows it to develop successful associate teams? Is John Mackey a transformational leader? Why or why not?

  Area of the deadweight loss

If a price ceiling of $13.71 is imposed, what will be the area of the deadweight loss?

  Would you agree which despite having the whistle-blower

After having reviewed the whistle-blower definition and statute, would you agree which despite having the whistle-blower statute in place, some workers are still apprehensive about coming forward with complaints?

  Explaining cultural dimensions theory

After researching the cultural dimensions theory, complete the following tasks: Go to http://www.geert-hofstede.com and identify how values in the United States compare to the world average in the following 3 categories.

  Initial margin requirement

You have 1,000 to invest in MML stock, which is selling at $40 per share. The initial margin requirement is 50%. Ignoring taxes and commissions, show in detail the impact on your rate of return if the stock rises to $70 a share assuming you buy it..

  Describe how it uses strategy to achieve goals

Our task is to choose a major, well-known firm and describe how it uses strategy to achieve its goals, to realize its mission in world business. Write this more in essay form rather than answering specific questions. In choosing a firm make ..

  What is your role in the decision-making processes

What are some effective practices that you would use for leading people and business processes in this situation? In this situation, what is your role in the decision-making processes that serve to establish an organizational climate oriented to meet..

  Explains the relationship between finance and accounting

Write a paper of 500-750 words that explains the relationship between finance and accounting, and how they operate to determine financial viability within a health care organization. Minimum of three references in APA style guidelines

  Discuss the way companies target your specific generation

In what generational cohort do you belong-Millennial, Gen X, Baby Boomer, or Silent Generation? Discuss the way companies target your specific generation. Use a specific company and their marketing tool.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd