Create a class named Yourlastname_Yourfirstname_hw5. Add the following default classes below this Yourlastname_Yourfirstname_hw5.class: Class Employee: Create...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a class named Yourlastname_Yourfirstname_hw5. Add the following default classes below this Yourlastname_Yourfirstname_hw5.class: Class Employee: Create a default class called Employee. An employee should include seven pieces of information as instance variables: 1. name: the name of the employee 2. id: an automatically generated string based on the year this employee was hired (4 digits) + this employee was the_th hire of the year (4 digits). For example, the 15th employee hired in 2020 should be "20200015". 3. hireYear: the year that the employee was hired. 4. username: automatically generated string based on the following rules: a. Get the first character of the employee's first name b. Get the employee's entire last name c. Join them together, and make each character lowercase d. Add a number at the end based on how many existing usernames that are the same to make sure that all usernames are unique For example, if the employee's name is David Smith and "dsmith", "dsmith2", and "dsmith3" already exist in the employees csv file, then David's username should be "dsmith4." 5. rank: an integer value in the range of 1 to 10 to show this employee's level within the company. The higher the number is, the higher rank this employee holds. 6. yearlyPayment: the employee's income for this year. 7. department: an object of the class Department. The department the employee works in. Also, create a static variable, called numEmployee, to keep track of the number of employee objects that have been created. Employee records should be stored in a .csv file called employees.csv in the following format: Each row represents an employee's information with each column representing different attribute values of the employees, i.e, name, id, username, rank, yearlyPayment, and department's departmentName in this order. Create a class named Yourlastname_Yourfirstname_hw5. Add the following default classes below this Yourlastname_Yourfirstname_hw5.class: Class Employee: Create a default class called Employee. An employee should include seven pieces of information as instance variables: 1. name: the name of the employee 2. id: an automatically generated string based on the year this employee was hired (4 digits) + this employee was the_th hire of the year (4 digits). For example, the 15th employee hired in 2020 should be "20200015". 3. hireYear: the year that the employee was hired. 4. username: automatically generated string based on the following rules: a. Get the first character of the employee's first name b. Get the employee's entire last name c. Join them together, and make each character lowercase d. Add a number at the end based on how many existing usernames that are the same to make sure that all usernames are unique For example, if the employee's name is David Smith and "dsmith", "dsmith2", and "dsmith3" already exist in the employees csv file, then David's username should be "dsmith4." 5. rank: an integer value in the range of 1 to 10 to show this employee's level within the company. The higher the number is, the higher rank this employee holds. 6. yearlyPayment: the employee's income for this year. 7. department: an object of the class Department. The department the employee works in. Also, create a static variable, called numEmployee, to keep track of the number of employee objects that have been created. Employee records should be stored in a .csv file called employees.csv in the following format: Each row represents an employee's information with each column representing different attribute values of the employees, i.e, name, id, username, rank, yearlyPayment, and department's departmentName in this order.
Expert Answer:
Answer rating: 100% (QA)
Here is the required program using Java programming language import javaio import javautil public class YourlastnameYourfirstnamehw5 public static void mainString args Department department1 new Depar... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
In some labor markets, the supply of labor is as follows (where W represents wages and L represents the number of employees): W = 113 + 0.21L However, the demand for labor is: W = 958 -0.28L a) At...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Create a class named Employee with the following private member variables. String employeeId String name Date dateOfBirth double Salary int yearsOfExperience The program should print the below 3...
-
12 7. In a group of 7 employees and 5 non-employees, four people must be chosen to ride together in a company vehicle with four seats. How many seating arrangements are possible if at least two...
-
Air at 25C flows at 30 x 10-6 kg/s within 100-mm-long channels used to cool a high thermal conductivity metal mold. Assume the flow is hydrodynamically and thermally fully developed. (a) Determine...
-
Write a complete program named Test2.java with a method named printPattern and the main method. The printPattern method displays a pattern of n/2 rows of ascending even numbers up to n. n should be...
-
Suppose there are \(n\) assets. Asset \(i, i=\) \(1,2, \ldots, n\), has rate of return \(r_{i}\) over a single period. There is also a risk-free asset with rate of return \(r_{f}\). The log-optimal...
-
In a recent year, Coach, Inc, a designer and marketer of handbags and other accessories, issued 12,100 shares of its $0.01 par value stock for $344,000 (these numbers are rounded). These additional...
-
Last year, Dixon Company produced 11,000 units and sold 9,000 units. The company had no beginning inventory Dixon incurred the following costs: Direct materials per unit Direct labor per unit...
-
ATV Co. began operations on March 1 and uses a perpetual inventory system. It entered into purchases and sales for March as shown in the Tableau Dashboard. Legend No Purchases or Sales Purchases...
-
You leave a pastry in the refrigerator on a plate and ask your roommate to take it out before you get home so you can eat it at room temperature, the way you like it. Instead, your roommate plays...
-
Expand the \(\left(x+x^{-1}ight)^{4}\).
-
In the given figure, spring constant is K, viscous friction coefficient is B, mass is M and the system output motion is \(y(t)\) corresponding to input force \(\mathrm{F}(t)\). Which of the following...
-
Using your university librarys business research resources and Internet sources, identify and discuss three key strategies that Volkswagen is using to compete in China.
-
Dad and Grandpa are each baking chocolate chip cookies. Each gives you two cookies. One of Dad's cookies has 14 chips in it and the other has Grandpa's cookies have 6 and 8 chips. a. Estimate the...
-
List two specific features of bad object-oriented modelling that are discouraged by the use of communication diagrams.
-
10. What is chest slapping by gorillas an example of? a. reassurance gesture b. display c. involuntary behavior d. affiliative behavior a. 11. Anatomical changes in hominins indicative of habitual...
-
Compare and contrast licensing and subcontracting.
-
What are four ways in which ecommerce project management differs from traditional project management?
-
What are the advantages of organizing data storage using a database approach?
-
Outline the typical steps in an agile development episode.
-
Dawson Industries began operations early in January 2024. On 31 December 2024, records showed the following asset, liability, equity, income and expense amounts: Required (a) Prepare a statement of...
-
Tiffany established The Marketing Store, an Instagram management business on 1 January 2024 as a sole trader business. She contributed $10 000 in cash to the business and did not withdraw funds for...
-
A new business graduate with one subject of accounting prepared the financial statements below for Amirs Delivery Service at the end of the first year of operations. Additional analysis revealed the...
Study smarter with the SolutionInn App