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.
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
|