2. Write a program named LastNamePhone that asks the user for their phone number in the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Write a program named LastNamePhone that asks the user for their phone number in the form XXX-XXX-XXXX, and determines whether or not the number is real (not enough or too many digits) or if it matches any of the numbers from the movies (middle 3 digits 555). In addition, check that they put in the -'s in the correct locations. Let the user know why it isn't a number if it isn't a number. (Bonus if you also check to make sure each group of 3 or 4 numbers is actually numbers). Examples: Enter your phone number: 123-456-7890 That is a legit number! Enter your phone number: 123-555-1234 That is a number from a movie! 2. Write a program named LastNamePhone that asks the user for their phone number in the form XXX-XXX-XXXX, and determines whether or not the number is real (not enough or too many digits) or if it matches any of the numbers from the movies (middle 3 digits 555). In addition, check that they put in the -'s in the correct locations. Let the user know why it isn't a number if it isn't a number. (Bonus if you also check to make sure each group of 3 or 4 numbers is actually numbers). Examples: Enter your phone number: 123-456-7890 That is a legit number! Enter your phone number: 123-555-1234 That is a number from a movie!
Expert Answer:
Answer rating: 100% (QA)
include include include usingnamespacestd boolisValidPhoneNumberconststringphone... View the full answer
Related Book For
Posted Date:
Students also viewed these operating system questions
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
answer all questions as instructed below. make sure you have attended all questions .Comparative Architectures (a) Describe the organisation of a two-level branch predictor that makes use of a global...
-
I have this data frame with the years and values, can you make a model to predict the value of meats,fish,fruits and vegetables and grains? based on the current values of the table and historical...
-
Read the step by- step hints and examples for writing a funding proposal at www.learnerassociates.net/proposal. Review the entire sample proposal online. What details did the writer decide to include...
-
Find the linear least squares polynomial approximation to f (x) on the indicated interval if a. f (x) = x2 + 3x + 2, [0, 1]; b. f (x) = x3, [0, 2]; c. f (x) = 1/x, [1, 3]; d. f (x) = ex , [0, 2]; e....
-
This exercise considers nursing home data provided by the Wisconsin Department of Health and Family Services (DHFS). Part 1: Use cost-report year 2000 data, and do the following analysis. a....
-
A government data processing center has been plagued in recent years by complaints from employees of back pain. Consultants have estimated that upgrading office furniture at a net cost of $430,000...
-
Daenerys, LLC provides cleaning service for homes and businesses. All sales are billed to clients with a credit terms that stipulate payment must be received 30 days after the invoice is received....
-
David, the owner of a local poster shop, comes to you for help. "We've only been breaking even the past two years, and I'm getting very frustrated! I don't know what to do because I feel like I've...
-
Consider the cash flows from the three activities (farming, forestry and mining) Farming Forestry Mining 50 50 50 50 Year 1 231 4 5 ... 10 11 12 thereafter 25 25 25 25 25 25 25 25 25 25 0 0 0 0 0 0 0...
-
At temperature \(T\), a balloon is partly inflated with an ideal gas to a volume of \(1.0 \mathrm{~L}\). The balloon is then put in a low-pressure container at the same temperature \(T\) and its...
-
Unproved property costs relative to the Williams lease were $40,000 at January 1, 2019. During 2019, $400,000 of drilling costs were incurred on the Williams lease. An 8%, $500,000 note is...
-
(a) Determine the composition of the liquid in equilibrium with a vapor containing 70 m o l % 70 m o l % benzene, 30 m o l % 30 m o l % toluene if the system exists in a vessel under a pressure of 2...
-
Ching and Ruthven (1985) found that the equilibrium of glucose on an ionexchange resin in the calcium form was linear for concentrations below 50 g / L 50 g / L . Their equilibrium expression at 303...
-
Subset the data set based on the location, day of the week, type of collision, and lighting condition. Compare these subsets of data to find interesting patterns. Can you identify any links between...
-
On January 1, Chronicle Energy Group, Inc. acquired an oil processing plant at a total cost of $ 13,530,000, and paid cash. The estimated cost ( in todays market) to dismantle the plant and restore...
-
How has the globalization of firms affected the diversity of their employees? Why has increased diversity put an additional burden on accounting systems?
-
Use MATLAB to calculate the following integrals: (a) (b) cos(x)e dx
-
Use the commands from Section 11.2 to show that: (a) tan(3x) = 3tanx- tan3x/1- 3tan2x (b) sin(x + y + z) = sinxcosycosz + cosxsinycosz + cosxcosysinz - sinxsinysinz
-
The position of a moving particle as a function of time is given by: Plot the position of the particle for 0 (t-15sin(3) y 100 (t15)os (0.8t) z 3/2) 100
-
Consider a two-level system, with basis \(|1angle,|2angle\), and in this basis, a Hamiltonian with elements \(\left(\begin{array}{ll}1 & 1 \\ 1 & 1\end{array} ight)\). Use the first form of the...
-
Use the practical variational method for the same harmonic oscillator ground state energy, with trial wave function \(\psi_{a}(x)=e^{-a y^{2}}\).
-
Use the Ritz variational method for the harmonic oscillator, with trial wave functions \(\psi_{1}(x)=\) \(e^{-y^{2} / 2}, \psi_{2}(x)=e^{-y^{2}}, \psi_{3}(x)=e^{-2 y^{2}}\), where \(y=x \sqrt{m...
Study smarter with the SolutionInn App