Data may include non-digit characters

Assignment Help Business Management
Reference no: EM131761184

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: EM131761184

Questions Cloud

Explain what feedback did you receive from other sources : Explain what feedback did you receive from other sources, such as your instructor or tutors? How did you use this feedback to revise your draft?
Encryption in organizations : Select one of the following and discuss in no less than three paragraphs, and have at least one response to another student of at least one paragraph:
Php application to read and compose a record : I am looking for someone who can help with this assignment. I am having trouble completing it. Extend your PHP application to read and compose a record
Do you think firms often lose money on new products : Do you think firms often lose money on new products? What do you think would happen to a company that often loses money on new products? Explain.
Data may include non-digit characters : NOTE 1: The input data may include non-digit characters, such as parentheses, dashes, etc.
Research one developing nation of your choice : Discuss, with examples, at least four (4) substantive ways in which a healthy population strengthens the economy of the country that you have selected.
Prepare a statement of cost of goods manufactured : Problem for Manufacturing Accounting: During July, Redard Corp's purchase of direct materials totaled $139,000; direct labor for the month was 4,200 hours.
Example of when to use the attribute on a form : Pick 5 HTML attributes and briefly describe their purpose and provide an example of when to use the attribute on a form.
You are an administrator for the contoso corporation : You are an administrator for the Contoso Corporation and Contoso is partnering with Litware.com, which will order products from Contoso.

Reviews

Write a Review

Business Management Questions & Answers

  Policy outcomes1 construct constitutive and operational

policy outcomes1. construct constitutive and operational definitions for any three of the actions and outcome variables

  Prepare a business report

Prepare a business report that gives an ethical analysis of the issues raised in the case study.- Identify the potential consequences to the project client of accepting this aggressive bid;

  Health and human services organizations

Explain how you would apply these characteristics and skills to a specific position within their organization. Be sure to also provide the Web site location of the company or organization's list of job qualifications

  Define the concept of a business model

Explains one of the cited articles in the essay question intelligently and/or uses an example to explain the point being made and/or uses a diagram to explain the point.

  What organizational model or structure would you select

Evaluate the paradigm shift from pre-modern (industrial) to this postmodern organizational perspective to identify any current ideas applicable to the Starbuck's case study in shifting from a task-oriented perceived culture to a people oriented cu..

  Calculate the wavelength of the waves on the string

Let's consider traveling waves that are generated on a string by an oscillator with a period of 1.52×10-4s. Assuming the speed of the waves to be 575 m/s, Calculate the wavelength of the waves on the string

  Work motivation - procedural justice theorya procedural

work motivation - procedural justice theorya procedural justice theory a process theory about work motivation that

  Business management and leadership-organizing

Business Management and Leadership-Organizing - Pretend that you have been asked to redesign the business structure of a particular division in the company you are working for

  Strategic managementselect a non-profit organization social

strategic managementselect a non-profit organization social group or volunteer agency that you know of or of which you

  Find the speed v of the balloon and angle

A hot-air balloon is rising vertically 20 ft/sec while the wind is blowing horizontally at 11 ft/sec. Find the speed v of the balloon and the angle θ it makes with the horizontal. Round to nearest whole number as needed.

  Determining the financial statement data

For the financial year 2013 the following financial statement data were available for Big Blue Pots Ltd and Small Red Pots Ltd. two competitor companies

  Smith also industry performed the work

Smith also Industry, CPAs, performed the audit work for a large corporation in connection with their registration statement. Smith also Industry performed the work according to all appropriate professional standards

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