Write a Java program that generates random numbers with your ID as the Class Name. Use a Do-While loop and a method to display a Menu Interface with the following options 1 - Register 2 - View When the user selects option 1: The program must ask the user to register by taking the following details with the help of a method called Register a. Index Number b. First Name c. Last Name d. Department e. Level f. Age This information must be written to a text file called Random Numbers. The program must now use a For loop to generate the random numbers with the users age as the seed in the following format: XXXX - XXXX - XXXX (where X can be any alphanumeric character)   When the user selects option 2: The program asks for the users Index Number The program checks if a random number has been generated for the user previously in the text file. If Yes: the program displays the Random Number If No: the program displays an error message using Try-Catch and displays the menu screen again.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question

Write a Java program that generates random numbers with your ID as the Class Name. Use a Do-While loop and a method to display a Menu Interface with the following options 1 - Register 2 - View When the user selects option 1: The program must ask the user to register by taking the following details with the help of a method called Register a. Index Number b. First Name c. Last Name d. Department e. Level f. Age This information must be written to a text file called Random Numbers. The program must now use a For loop to generate the random numbers with the users age as the seed in the following format: XXXX - XXXX - XXXX (where X can be any alphanumeric character)

 

When the user selects option 2:

The program asks for the users Index Number

The program checks if a random number has been generated for the user previously in the text file.

If Yes: the program displays the Random Number

If No: the program displays an error message using Try-Catch and displays the menu screen again.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,