2. 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: a. The first...


Java but not with string format


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

Extracted text: 2. 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: a. The first 3 digits may not contain an 8 or 9. b. The second set of three digits must be larger than 100 and less than 888. 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 is a valid number.

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here