# CS 570: Programming Foundations Homework Assignment #8 Solved

30.00 \$

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . ` zip` solution files instantly, after Payment

## Description

5/5 - (1 vote)

Note: This and all assignments given in this course can be and must be solved using only the materials that have been discussed in class.Â  Do not look for alternative methods that have not been covered as part of this course.

Â

Program (100 points):

In this assignment, we are going to practice using linked lists.Â  To that effect, we will create and manipulate a linked list of employees to simulate a payroll application.Â  First, you will need to create an Employee class, according to the specifications below.

Specification for Employee class:

# Attributes

• Employee ID: a string â€“ the ID will contain digits and/or hyphens.
• Number of hours worked in a week: a double containing how many hours the employee has worked.
• Hourly pay rate: a double that represents how much the employee is paid for one hour or work.
• Gross wages: a double that stores the number of hours times the hourly rate.

# Methods

• default constructor: initializes attributes to blank or zeroes.
• alternate constructor: receives and sets an employee ID.
• set methods for each attribute (accessors).
• get methods for each attribute (mutators).
• a printEmployee: that displays all the information of a given employee.

# Driver File

When the program starts, it should ask the user to enter each of the employeesâ€™ IDs. There should be no limit on the number of IDs the user can enter. The program then should display each employee identification number and ask the user to enter that employeeâ€™s hours and pay rate. The program should calculate the gross wages for that employee (hours times pay rate).Â  The data for all employees is stored in a linked lists of Employee nodes.

After the wages have been calculated for all the employees, the program should display each employeeâ€™s identification number, hours worked, hourly rate, and gross wages.

Make sure your program validates the data input: do not accept negative numbers for hours worked or numbers less than 6.00 for pay rate.

Here are a couple of sample runs of a typical solution to this problem:

Note:Â  Please make sure to submit well-written programs for these programming tasks. Good identifier names, useful comments, indentation, and spacing will be some of the criteria that will be used when grading this assignment.

• Week-8.zip