Java

3-3 Java: Using Random Class – Classes and Objects



Java Software Solutions: Foundation of Program Design
Using Classes and Objects
Homework 3.2 – Using The Random Class
Write a program that creates and prints a random phone number of the form XXX-XXX-XXXX.
Include the dashes in the output. Do not let the first three digits contain an 8 or 9 (but don’t be more restrictive than that), and make sure that the second set of three digits is no greater than 742.

Leave a Reply

Your email address will not be published. Required fields are marked *