Question: Write a program that constructs a random telephone number of the form (XXX) XXX-XXXX and outputs a formatted string (parentheses and dashes included) according to

 Write a program that constructs a random telephone number of the

Write a program that constructs a random telephone number of the form (XXX) XXX-XXXX and outputs a formatted string (parentheses and dashes included) according to the following rules: The first 3 digits may not contain an 8 or 9. The second set of three digits must be larger than 100 and less than 888. a. b. You must construct the desired string (using Random class) and then output it accordingly. Until you are confident in your code, seed the random number generator with 0. For example, (777)-101-0000 ls avalid number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!