COMP 274 COMP274 COMP/274 Week 2 Lab Inheritance and Polymorphism – DeVry University

Page 1

COMP 274 COMP274 COMP/274 Week 2 Lab Inheritance and Polymorphism – DeVry University

DOWNLOAD SOLUTION https://www.solvedcollegepapers.com/product/comp-274-comp274-comp-274-ity/ The objective of this programming assignment is to experience the use of inheritance in Java and to see how polymorphism works with inheritance in Java. The assignment involves writing three classes, plus a test class. The base class is an employee class which contains a couple of attributes common to all employees and a fundamental method to calculate pay. The two derived classes are a commissioned employee that adds payment of a sales commission as part of the pay calculation, and a union employee which adds overtime payment and union dues as part of the pay calculation. Category: Assignments Help Experts Tags: COMP 274 COMP274 COMP/274 Application Programming with Lab - DeVry University, COMP 274 Entire Course, comp 274 week 1, COMP 274 Week 1 Lab, comp 274 week 2, COMP 274 Week 2 Lab Inheritance and Polymorphism, comp 274 week 3, COMP 274 Week 3 Lab Java Application GUI, comp 274 week 4, COMP 274 Week 4 Lab Java Program to Convert Temperature, comp 274 week 5, COMP 274 Week 5 Lab Timer and Mouse Events and Java Graphics, comp 274 week 6, COMP 274 Week 6 Lab Calendar Program, comp 274 week 7, comp 274 week 7 lab, COMP 274 Week 7 Lab Java Doc, comp 274 week 7 programming assignment, COMP 274comp 274, COMP 274comp 274 week 7, comp274 week 7, java 

Description

Description


COMP 274 Week 2 Lab Inheritance and Polymorphism – DeVry University The objective of this programming assignment is to experience the use of inheritance in Java and to see how polymorphism works with inheritance in Java. The assignment involves writing three classes, plus a test class. The base class is an employee class which contains a couple of attributes common to all employees and a fundamental method to calculate pay. The two derived classes are a commissioned employee that adds payment of a sales commission as part of the pay calculation, and a union employee which adds overtime payment and union dues as part of the pay calculation. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. The details of the three classes to be implemented are as follows: 

An Employee contains a name, a department where the employee works, and an hourly rate of pay. An explicit value constructor should be provided to set all three values when an Employee object is created. There should be mutator methods to set the values of the department and the pay rate. There should be one accessor method which returns a string containing the name and the department in which the employee works. Finally, there should be a weekly pay method that takes an integer parameter for the number of hours worked and returns the weekly pay. If the number of hours worked is less than 40 hours, the pay is the number of hours times the rate. If the number of hours worked is 40 or more, the pay is 40 times the rate. The Union Employee inherits from the Employee class. A Union Employee contains a dues variable which holds the amount of dues a Union Employee has withheld from their paycheck each week. An explicit value constructor should be provided to set all three values from the base class along with the dues value. There should be a mutator method provided to set the dues variable. The base class weekly pay method should be overridden because a Union Employee gets 1.5 times the rate for any hours over 40 per week. This method should use the base class method to calculate pay for first 40 hours and then add the overtime amount. Also the weekly pay is reduced by the amount of dues withheld. The Commission Employee inherits from the Employee class. A Commission Employee contains a commission rate and a sales amount variable which are used as part of the pay calculation. An explicit value constructor should be provided to set all 3 values of the base class along with the commission rate variable. There should be mutator methods for the commission rate and the sales amount. The base class weekly pay method should be overridden because the Commission Employee gets the base employee pay plus the commission rate times the sales amount. This method should use the base class weekly pay method to calculate the hourly part of the pay. The test program needs to create a Union Employee object and a Commission Employee object. The test program must contain a display method which takes a base class Employee object reference along with the number of hours worked by the employee. The


display method should use the base class method to get the employee name and department info and output that information. The display method should also use the base class method to get the weekly pay info for the employee object and display that information. The test program should pass the Union Employee object and the Commission Employee object to the display method along with the number of hours each employee has worked. It should test the payroll calculation for the number of hours worked to be less than 40, 40, and greater than 40 hours for each employee type. The output seen should demonstrate polymorphic behavior, that is the base class Employee reference to a Union Employee object elicits Union Employee pay calculations, and the base class Employee reference to a Commission Employee elicits Commission Employee payroll calculations. Take screen shots of the output of the program. Paste the screen shots and your source code for all your classes into a Word document. Download Full Course Solution: ENTIRE ONLINE CLASS HELP EACH-CHAMPLAIN COLLEGE https://www.solvedcollegepapers.com/product/entire-online-class-help/ Entire Online classes help: book @125 per Week. All Done from Scratch

Download Full Course Solution: IT/IT 212 IT212 IT/212/Recommendation of local area network topology https://www.solvedcollegepapers.com/product/it-212-it212-lan-topology/ Overview In Milestone One, you will: -Given the provided scenario, explain the key considerations (must-haves) and constraints of the networking project at the firm’s new location. -Then make a well-reasoned recommendation of local area network (LAN) topology. You have been asked for your input regarding the new Fayetteville, NC, office setup project. Conduct research and deliver a report to the team with key considerations and recommendations for the setup of the network infrastructure. Fayetteville office will be home to 50 employees, including the new executive vice president of sales and marketing. All possible sites have offices located in an office building with access to fiber, cable, and T1 internet service providers. The site must support live video teleconferencing calls with employees based at the other sites. It must also reliably send print jobs to billboard printers located in the company headquarters. Download Full Course Solution: BUS 303 Human Resource Management Entire Course Help


https://www.solvedcollegepapers.com/product/bus-303-human-resource-managemententire-course-help/ BUS 303 Human Resource Management Entire Course Help> Ashford University Bus 303 Human Resource Management Week 1 Quiz 1.docx Bus 303 Human Resource Management Week 1 Quiz 1.docx BUS 303 – Fall 2018 Bus 303 Human Resource Management Week 1 Quiz 1.docx 5 pages BUS 303 Week 1 quiz.docx Download Full Course Solution: [New Answers]-Full course CMIT-200: Relational Database Design and SQL https://www.solvedcollegepapers.com/product/cmit-200-relational-database-design-andsql/ Course Description and Prerequisites A relational database management system (RDBMS) is the heart of most modern information systems. This is a survey course in relational database design, development, and implementation. The course covers key concepts of database design using entity relationship diagrams (ERDs), normalization, and functional dependence. Logical and physical schemas and the use of Structured Query Language (SQL) to query data will be studied in depth. Student learning is reinforced through discussions and hands-on laboratory assignments. Students will complete a relational database project by using a relational database management system. This course is intended for anyone who is involved in designing, developing, or implementing relational database management systems (e.g., users, IT managers, technical staff, and other IT team members). Prerequisite: CMIT-135 Student-Centered Learning Outcomes      

Design a relational database using entity relationship diagrams and SQL Normalize relational database tables through third normal form (3NF) Differentiate between conceptual, logical, and physical database designs Specify different types of relationships between database entities and objects Physically create databases using SQL Data Definition Language (DDL) Query databases using SQL Data Manipulation Language (DML)



Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.