Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design two classes named Employee and Timecard to represent employee and timecard data as follows: For the Employee class, the data fields are: int

 

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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... 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

Java Programming

Authors: Joyce Farrell

9th edition

1337397075, 978-1337397070

More Books

Students also viewed these Programming questions