Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hhi all teacher .... I need help for me code .....please...please ....please...!!! this is for last project for final grand for me.... I need past

image text in transcribedimage text in transcribedhhi all teacher ....

I need help for me code .....please...please ....please...!!!

this is for last project for final grand for me.... I need past for Java class....help me ... please

Java Lab - User Id and Password Entry Revised Objective: This project is a revision of the previous Password project. The user information entered will be written as a record to an output file. Menu option 2 will be added that allows all the user accounts to be read from the file and displayed to the console. Arrays will be implemented and used as a reference for validation and in the display process. Instantiable class UserInfo: String userId String userPassword Integer user Status: o 1-Commuter no meal plan O 2 - Commuter with meal plan o 3 - Dorm Char user Program: o B-Business OP - Programming O L - Lasers O R- Robotics O N -Networking o S-Social Media getters and setters Default constructor (your choice of default values) Parameterized/overloaded constructor (accepts all four fields and sets them) UserEntry Program: Define a hard-coded char array to hold the valid user program values (used for validating searching) Define a hard-coded String array to hold the user program names (used when displaying user info) Define a hard-coded String array to hold the user status names (used when displaying user info) File stream objects to read and write data to an external file Menu: Menu Option 1 changes: 0 Add a loop to prompt and validate for user status (must meet the following specifications): . Must be a number 1-3 Use a try/catch to validate for numeric entry . Do not exit loop until user status is valid. User must get it right. o Add a loop to prompt and validate for program (must meet the following specifications): Must be a single character Must be a B, L, N, P, R or S Create a hard-coded array to store these values IVILISL UU d IILITUD 1 - 0 . Use a try/catch to validate for numeric entry Do not exit loop until user status is valid. User must get it right. Add a loop to prompt and validate for program (must meet the following specifications): . Must be a single character . Must be a B, L, N, P, R or S . Create a hard-coded array to store these values Use a search loop to validate the value entered is in the array. The subscript must be saved so that it can be used to access the program description array. . Do not exit loop until user program is valid. User must get it right. After all four fields are valid instantiate a UserInfo object with the data (use the parameterized constructor). Do not instantiate this object right away like the previous project, but only after the data is entered and validated. Write the user information as a fixed-length record to the file. Each record will occupy a separate line in the file. When formatting the record, user id and password should occupy 12 positions each, status and program 1 position each, for a total record length of 26. The getters from the UserInfo class should be used to retrieve the data from the object. O o o Display a successful add message until the user presses Enter Menu Option 2 - Display all users: o When this option is chosen, use a file read loop, and display the user information in a formatted report layout to the console. Use column headings at the top of the report, and single space the records. Display a count of users on a total line at the bottom. Be sure to pause the screen. When user presses Enter, the program will return to the Menu. o Be sure to instantiate your file Scanner object each time Menu option 2 is selected. Doing so ensures that the file pointer will start at the beginning of the file. This project is worth 30 points. Lab 5 Password Page 1 of 1 Java Lab - User Id and Password Entry Revised Objective: This project is a revision of the previous Password project. The user information entered will be written as a record to an output file. Menu option 2 will be added that allows all the user accounts to be read from the file and displayed to the console. Arrays will be implemented and used as a reference for validation and in the display process. Instantiable class UserInfo: String userId String userPassword Integer user Status: o 1-Commuter no meal plan O 2 - Commuter with meal plan o 3 - Dorm Char user Program: o B-Business OP - Programming O L - Lasers O R- Robotics O N -Networking o S-Social Media getters and setters Default constructor (your choice of default values) Parameterized/overloaded constructor (accepts all four fields and sets them) UserEntry Program: Define a hard-coded char array to hold the valid user program values (used for validating searching) Define a hard-coded String array to hold the user program names (used when displaying user info) Define a hard-coded String array to hold the user status names (used when displaying user info) File stream objects to read and write data to an external file Menu: Menu Option 1 changes: 0 Add a loop to prompt and validate for user status (must meet the following specifications): . Must be a number 1-3 Use a try/catch to validate for numeric entry . Do not exit loop until user status is valid. User must get it right. o Add a loop to prompt and validate for program (must meet the following specifications): Must be a single character Must be a B, L, N, P, R or S Create a hard-coded array to store these values IVILISL UU d IILITUD 1 - 0 . Use a try/catch to validate for numeric entry Do not exit loop until user status is valid. User must get it right. Add a loop to prompt and validate for program (must meet the following specifications): . Must be a single character . Must be a B, L, N, P, R or S . Create a hard-coded array to store these values Use a search loop to validate the value entered is in the array. The subscript must be saved so that it can be used to access the program description array. . Do not exit loop until user program is valid. User must get it right. After all four fields are valid instantiate a UserInfo object with the data (use the parameterized constructor). Do not instantiate this object right away like the previous project, but only after the data is entered and validated. Write the user information as a fixed-length record to the file. Each record will occupy a separate line in the file. When formatting the record, user id and password should occupy 12 positions each, status and program 1 position each, for a total record length of 26. The getters from the UserInfo class should be used to retrieve the data from the object. O o o Display a successful add message until the user presses Enter Menu Option 2 - Display all users: o When this option is chosen, use a file read loop, and display the user information in a formatted report layout to the console. Use column headings at the top of the report, and single space the records. Display a count of users on a total line at the bottom. Be sure to pause the screen. When user presses Enter, the program will return to the Menu. o Be sure to instantiate your file Scanner object each time Menu option 2 is selected. Doing so ensures that the file pointer will start at the beginning of the file. This project is worth 30 points. Lab 5 Password Page 1 of 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions