Question: in java Ive created an empty class called EmployeeAdd. This will be a Library type class; similar to what a header file in C does.

in java

Ive created an empty class called EmployeeAdd.

This will be a Library type class; similar to what a header file in C does. In this class you must write code that takes as input a name, and the type of user this person will be. Name will be first name only, user will be admin or user. Based on which type of user is sent, you will write that user to the appropriate admins.txt or users.txt files.

Details: Write a function in the EmployeeAdd class called write_to_file. This function, write_to_file should take two piece of input, both Strings. A name, and a user_type. It will be called like so: EmployeeAdd.write_to_file(John,admin) This will write the name John to the admins.txt file. You MUST append names to the file, not just write names to the file. Remember, when writing to a file theres a difference between writing (usually overwriting) and appending (adding additional information). We covered this in week 1 in FileWriter (hint). If your code successfully write to the admins/users text file in the project directory you are successful.

You MUST write to the files in the directory. I will provide you with the the project folder to use (or import into another IDE). Youll add your code in EmployeeAdd. Requirements/Grading: For assignments going forward you will be graded on the following 4 items items.

1. 2 pts Comments bare minimum you name should be provided at the top. To get the full 2 pts you must also provide meaningful comments; you dont need to go overboard. 2.

2 pts Name the method write_to_file as detailed in Details. 3.

4 pts the method takes input exactly as detailed. I dont need to provide any more info. Just name and what the users account type will be. 4.

4 pts I should not need to modify the file path at all in your code. This is why Im giving you the Project directory. You should be able to reference the file without a fully qualified path. I should be able to import your new library class into my Project seamlessly. No formal extra credit will be listed, but Ill always give extra credit for well written code, solid error and exception handling, etc.

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!