Reference no: EM13950600
Design an algorithm (no code) just using if-then statement or while statement generically, that validates a US phone number in the form of (xxx) xxx-xxxx.
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.
Develop an algorithm to verify if a string of characters could represent a valid U.S. phone number. Since 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.
The 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.
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.
Who is attempting to teach without inspiring the pupil
: A teacher who is attempting to teach without inspiring the pupil with a desire to learn is hammering on cold iron." - Horace Mann
|
How can business move from mail order to online presence
: Apply ethical research and inquiry skills and demonstrate an understanding of the social impact of information technology and the need for security, privacy and ethical implications in information systems usage
|
Surroundings and the effects of motion and gravity
: A pump operating at steady state takes in saturated liquid water at 65 lbf/in.2 at a rate of 10 lb/s and discharges water at 1000 lbf/in.2 The isentropic pump efficiency is 80.22%. Heat transfer with the surroundings and the effects of motion and ..
|
What qualities would you expect the firm
: Would there be a universal list, or would lists differ on a country-by-country basis? what qualities would you expect the firm to be seeking in these managers?
|
Design an algorithm (no code) just using if-then statement
: 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..
|
Prepare consolidated income statements for solvent company
: Prepare consolidated income statements including the distribution of income to the controlling and noncontrolling interests for 20X1 and 20X2.
|
Power developed by the turbine
: Water vapor at 6 MPa, 600°C enters a turbine operating at steady state and expands adiabatically to 10 kPa. The mass flow rate is 2 kg/s and the isentropic turbine efficiency is 94.7%. Kinetic and potential energy effects are negligible. Determine..
|
What is the apr earned on the account
: You and your spouse recently purchased a 300,000 home with 75,000 down, and financing the rest using a 30-year mortgage with a nominal interest rate of 4.25%. Mortgage payments are made at the end of each month. How much of the first 3 years of mo..
|
Short biography of web du bois
: What Should Education Teach- W.E.B. Du Bois was the first African American to earn a doctorate from Harvard. He fought for African American rights and cofounded the NAACP. Du Bois sought social, economic and political reforms to expand equality an..
|