Design two classes named Employee and Timecard to represent employee and timecard data as follows: For...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Design two classes named Employee and Timecard to represent employee and timecard data as follows: For the Employee class, the data fields are: int empNo; String last; String first; double payRate; For the Timecard class, the data fields are: int empNo; String weekEndingDate; double hrs Sat; double hrsSun; double hrsMon; double hrsTue; double hrswed; double hrsThu; double hrsFri; All data fields should be declared as private, and associated getters and setters should be declared in each class. Also include a getTotalHrs() instance method in the Timecard class. Your project's file structure should look as follows: Projects X Files Lab09A Source Packages lab09a Employee.java TestEmployee Timecard.java Timecard.java Test Packages Libraries To capture all input data, you should use: String input = JOptionPane.showInput Dialog (JOptionPane.showInput Dialog() To parse all input into variables, you should use: StringTokenizer st = new StringTokenizer (input, " ");) String weekEndingDate = st.nextToken(); int empNo = Integer.parseInt (st.nextToken ()); String last = st.nextToken(); String first = st.nextToken(); double payRate Double.parseDouble (st. nextToken()); etc. To put out the output, use a single String variable to concatenate all the output and then pass that to JOptionPane.showMessageDialog(null, output): = Sample Java input Input ? X Enter week ending date, empNo, last name, first name, payrate, and Sat-Fri hours: 04/27/2018 456789 Marx James 10.00 0.5 0.5 8.28.28.28.28.2 ОК Cancel Sample Java output Message i Week Ending Date: 04/27/2018 Employee Number: 456789 First Name: James Last Name: Marx Pay Rate: $10.00 Total Hours: 42.0 Total Pay: $430.00 OK X Design two classes named Employee and Timecard to represent employee and timecard data as follows: For the Employee class, the data fields are: int empNo; String last; String first; double payRate; For the Timecard class, the data fields are: int empNo; String weekEndingDate; double hrs Sat; double hrsSun; double hrsMon; double hrsTue; double hrswed; double hrsThu; double hrsFri; All data fields should be declared as private, and associated getters and setters should be declared in each class. Also include a getTotalHrs() instance method in the Timecard class. Your project's file structure should look as follows: Projects X Files Lab09A Source Packages lab09a Employee.java TestEmployee Timecard.java Timecard.java Test Packages Libraries To capture all input data, you should use: String input = JOptionPane.showInput Dialog (JOptionPane.showInput Dialog() To parse all input into variables, you should use: StringTokenizer st = new StringTokenizer (input, " ");) String weekEndingDate = st.nextToken(); int empNo = Integer.parseInt (st.nextToken ()); String last = st.nextToken(); String first = st.nextToken(); double payRate Double.parseDouble (st. nextToken()); etc. To put out the output, use a single String variable to concatenate all the output and then pass that to JOptionPane.showMessageDialog(null, output): = Sample Java input Input ? X Enter week ending date, empNo, last name, first name, payrate, and Sat-Fri hours: 04/27/2018 456789 Marx James 10.00 0.5 0.5 8.28.28.28.28.2 ОК Cancel Sample Java output Message i Week Ending Date: 04/27/2018 Employee Number: 456789 First Name: James Last Name: Marx Pay Rate: $10.00 Total Hours: 42.0 Total Pay: $430.00 OK X
Expert Answer:
Answer rating: 100% (QA)
Answer Employeejava public class Employee private int empno private String last first private double payRate public Employee thisempno 0 thislast thisfirst thispayRate 0 public Employeeint empno Strin... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Kevin made two investments over the past two years. His first investment wasabaseball card thatcost$50.00,whichhe sold three months later for$55.00.The second wasashare of stockinastart-upcompany....
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
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...
-
Consider the modules diagram in question 17. Suppose we want the code in module com.sf to depend on code in module com.ny. Which of the following directives goes into module com.nys module-info file...
-
For the beam of Sample Problem 4.2, determine the range of values of P for which the beam will be safe knowing that the maximum allowable value of each of the reactions is 45 kips and that the...
-
Star Solar Panels accounts for production costs using the FIFO method of process costing. Direct materials are all added at the beginning of production and conversion costs are incurred uniformly...
-
Create recommendations for an organization that is facing resistance to change from its own HR department. What are some of the likely causes of this resistance? How can they be overcome?
-
Casey Belzer runs a small machine shop that fabricates parts for sprayers used in foam insulation equipment. With the renewed interest in green building practices and high energy costs demand for his...
-
Kramerica Industries has come up with an ingenious business plan. Kramerica has two divisions. The first division manufactures the most delicious ice cream in the world. One scoop of this ice cream...
-
On 1/09/2017 "ABC" Company received $30,000 from customer "X" for services to be performed evenly over a 12 months period starting 1/12/2017. In addition, on 1/10/2017 "ABC" received $11,880 from...
-
Chad and Amy are married with no children, and they're filing their federal income tax return. Chad had a gross income of $54,300 last year, while Amy had a gross income of $50,900; they plan to use...
-
Lori is a student who teaches golf on Saturdays. In a year, she earns $20,000 after paying her taxes. At the beginning of 2021, Lori owned $1,000 worth of books, clothes, and golf clubs and she had...
-
Older Workers Are Being Pushed Out of the Job Market Compared to pre-pandemic levels, the number of people aged 55 and over who are in the labor force has decreased by 2 million. Corporate trends...
-
What was Michaels gross investment, depreciation, and net investment during 2022? Michael, an Internet service provider, bought an existing business worth $400,000 on December 31, 2021. During 2022,...
-
What is the principle of diminishing marginal benefit? In Problem 14, which marginal benefit diminishes fastest: Sams, Nicks, or the societys? Problem 14 The table sets out the marginal benefits that...
-
Calculate the inflation rates for the years ended June 2020 and June 2021. How did the inflation rate change in 2021? The BLS reported the following CPI data: June 2019 June 2020 June 2021 256.1...
-
14) Provide the reagents necessary to complete the following transformation. CHCH CHCH A) CH3CO3H B) 1. CH3CO3H 2 H+, HO C) HO, HSO4 D) OsO4, H02 E) 1. BH3 THF 2. H0, HO 15) Provide the reagents...
-
A 20-cm-square vertical plate is heated to a temperature of 30oC and submerged in glycerin at 10oC. Calculate the heat lost from both sides of the plate.
-
Create a file that contains a line of your favorite song lyric. Use a text editor such as Notepad, and save the file. Copy the file contents, and paste them into a word-processing program such as...
-
a. Sammys Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas to tourists. In Chapter 2, you wrote an application that prompts the user for the number of...
-
Write an application that asks a user to enter three integers. Display them in ascending and descending order. Save the file as AscendingAndDescending.java.
-
A burst of compressed air pushes a pellet out of a blowpipe. The force exerted by the air on the pellet is given by \(F(t)=F_{0} e^{-t / \tau}\), where \(\tau\) is called a time constant because it...
-
Thrust is the force that pushes a rocket forward. It is a force exerted on the rocket as the engine expels hot gases from the rear of the rocket. For most rockets, thrust is variable rather than...
-
Assume you want to use random tests on an FIR filter program. How would you know when the program under test is executing correctly?
Study smarter with the SolutionInn App