Designing a string-checking algorithm

Assignment Help Data Structure & Algorithms
Reference no: EM13948923

Designing a String-Checking Algorithm

In many situations, information is supplied as a string of text characters. The characters of that information may need to be in a particular format to be valid. Common examples include credit card numbers, e-mail addresses, dates, and telephone numbers.

In this Application, you will develop an algorithm to verify if a string of characters could represent a valid U.S. phone number.

Determining whether a string of characters is actually a valid phone number is a complex process. Therefore, you will determine only if the characters in the string appear in a format appropriate for such a phone number.

Perform the following tasks:

1. Design an algorithm to determine if an input string is in a format appropriate for a U.S. phone number. Your algorithm should accept any string in the form (xxx) xxx-xxxx, where x represents a digit and the other characters represent themselves, and reject all others. For this algorithm, you can determine the total number of characters in the string and inspect the value of one character at a time.

2. Provide an example of an input string that is in the proper format and an example that is not in the proper format. Describe how your algorithm determines that the first string is in the proper format and that the second string is not in proper format.

3. Describe your algorithm clearly and precisely.

Reference no: EM13948923

Questions Cloud

Compute the budgeted divisional roi for the air conditioner : Compute the ROI for each investment project. Compute the budgeted divisional ROI for The air conditioner investment is made.
What principles of distributive negotiation did sherman use : Based on the above reading and the knowledge gained from your assigned readings, respond to the following questions: What principles of distributive negotiation did Sherman use to gain his advantage? Do you think Sherman behaved ethically? Why or why..
How much higher or lower is this intensity compared : How much higher or lower is this intensity compared to the 100 keV beam penetration 20 cm of soft tissue - how much higher would the incident intensity, in photons/mm2, need to be for the 20 KeV beam than with the 100 KeV beam?
Change in dividend than with actual amount of dividend : Dividends tend to fluctuate in direct relation to changes in annual earnings. Managers are less concerned with the change in the dividend than with the actual amount of the dividend. Managers tend to avoid smooth dividends as they don't signal the fi..
Designing a string-checking algorithm : Provide an example of an input string that is in the proper format and an example that is not in the proper format. Describe how your algorithm determines that the first string is in the proper format and that the second string is not in proper fo..
Calculate the roi for the division without the investment : Compute the ROI for the division without the investment. Compute the margin and turnover ratios without the investment. Show that the product of the margin and turnover ratios equals the ROI computed in Requirement 1.
Determine the velocity and acceleration of point : The disk rotates about the shaft S, while the shaft is turning about the z axis at a rate of vz = 4 rad>s, which is increasing at 2 rad>s2. Determine the velocity and acceleration of point A on the disk at the instant shown. No slipping occurs.
Define two applications or cases of game theory in business : The companies can only offer one of three possible plans. One of the companies (South Wireless) contracted a market study to estimate the potential number of customers under each circumstance.
Advantage and disadvantage of your chosen training methode : Recommend a specific employee training method that you think would be most effective for a healthcare organization, and determine one advantage and one disadvantage of your chosen training method. Provide support for your rationale

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write recursive version of array-based linear search

Write an algorithm but not code. Write a recursive version of the array-based linear search algorithm. Write a recursive version of the linked-list-based linear search algorithm."""

  Discuss some of the emerging trends in information

Discuss some of the emerging trends in information(e.g. computer hardware, software and data analysis

  Time n-processor common crcw pram algorithm

present an O(1) time n-processor common CRCW PRAM algorithm for computing the boolean AND of n bits.

  Calculate mccabe''s cyclamate numbe

Show that McCabe's cyclamate number is an interval scale measure. and  Calculate McCabe's cyclamate number on the following source code. Draw a control ?ow graph. Label the regions with Roman numerals.

  Describe purpose of queue in breadth-first traversal

Describe the purpose of queue in breadth-first traversal? Assume you had function call displayAtDepthN, which when given tree and depth would display only nodes at that depth.

  Analyze spanning tree creation

To assess the resiliency of typical network access switch block using Hot Standby Router Protocol (HSRP ) along with Spanning Tree Protocol and VLANs .

  Design a circular double linked list

Design a circular double linked list, for which the following operations should be implemented

  Display all columns and all rows from the employees table.

Write SELECT statements for the following questions. Make sure to include the statement execution, including the resulting data.

  Data warehouse and operational databases

Every big organization has large documents or databases containing data used in operating the business. Does a data warehouse differ from these operational files or databases?

  Evaluation of quicksort and heapsort

Evaluation of QuickSort and HeapSort

  Calculate the total weights and values of each subset

Use the decrease-by-one technique to generate the power set and calculate the total weights and values of each subset, then find the largest value that fits into the knapsack and output that value.

  Creating an object oriented data model

Create an object oriented data model, including all appropriate notations, to represent the given situation. In a particular region there are a number of gardens.

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