Comp 274 Week 2

In: Philosophy and Psychology

Submitted By alexmicane
Words 760
Pages 4
HELPIDO.COM

-------------------------------------------------------
Follow this link to get the tutorial

http://helpido.com/comp-274-week-2/
-------------------------------------------------------

COMP/274 Week 2 - Inheritance and Polymorphism
________________________________________

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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior.
NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program!
The details of the three classes to be implemented are as follows:
A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE workerInfo method that returns a string containing the name, hourly pay rate, and federal tax rate. There must be a grossPay method that takes the number of hours worked as a parameter and calculates the gross pay (hours * payRate) and returns that as a double. There must be a taxWithheld method that takes a gross pay amount as a parameter and calculates the tax withheld (grossPay * taxRate) and returns that as a double.…...

Similar Documents

Comp 274 Week 2

...HELPIDO.COM ------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-2/ ------------------------------------------------------- COMP/274 Week 2 - Inheritance and Polymorphism ________________________________________ 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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program! The details of the three classes to be implemented are as follows: A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE workerInfo method that returns...

Words: 760 - Pages: 4

Comp 274 Week 2

...HELPIDO.COM ------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-2/ ------------------------------------------------------- COMP/274 Week 2 - Inheritance and Polymorphism ________________________________________ 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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program! The details of the three classes to be implemented are as follows: A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE workerInfo method that......

Words: 760 - Pages: 4

Comp/274 Week 2 - Inheritance and Polymorphism

...HELPIDO.COM ------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-2/ ------------------------------------------------------- COMP/274 Week 2 - Inheritance and Polymorphism ________________________________________ 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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program! The details of the three classes to be implemented are as follows: A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE workerInfo method that......

Words: 760 - Pages: 4

Comp/274 Week 2 - Inheritance and Polymorphism

...HELPIDO.COM ------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-2/ ------------------------------------------------------- COMP/274 Week 2 - Inheritance and Polymorphism ________________________________________ 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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program! The details of the three classes to be implemented are as follows: A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE workerInfo method that......

Words: 760 - Pages: 4

Comp274 Comp 274 Comp/274 Week 2

...HELPIDO.COM ------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-2/ ------------------------------------------------------- COMP274 COMP 274 COMP/274 Week 2 - Inheritance and Polymorphism ________________________________________ 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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program! The details of the three classes to be implemented are as follows: A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE......

Words: 763 - Pages: 4

Comp274 Comp 274 Comp/274 Week 2

...HELPIDO.COM ------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-2/ ------------------------------------------------------- COMP274 COMP 274 COMP/274 Week 2 - Inheritance and Polymorphism ________________________________________ 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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program! The details of the three classes to be implemented are as follows: A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE......

Words: 763 - Pages: 4

Comp274 Comp/274 Comp 274 Week 4

...------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-4-3/ ------------------------------------------------------- COMP 274 - Week 4 Programming Assignment ________________________________________ Write a Java GUI application to allow you to experiment with colors and fonts. The general appearance of you GUI should be something similar to the following: Your program must meet the following requirements: 1. Do not use any of the GUI editing capabilities of Eclipse for this assignment. Do all the GUI layout work based on what you have learned in class in the last 2 weeks. 2. You can use either inheritance or composition to get a JFrame into your application. 3. All member variables must be private. 4. The GUI and event handling setup must be done in the constructor of your GUI class or in privatemethods called from the constructor. Hint: it would seem logical to have a private method to build the top, left, and bottom panels. 5. The main text field (the red one above) will be used to show the results from the selection of font size, bold and italic selection, and foreground and background color selection. 6. The display must have a label and JTextField where the user inputs a font size value and which must appear in the upper part of the frame as shown above. 7. There must also be 2 check boxes that will control whether the font has bold and/or......

Words: 801 - Pages: 4

Comp 274 Comp274 Comp/274 Week 6

...HELPIDO.COM ------------------------------------------------------ Follow this link to get the tutorial http://helpido.com/comp-274-week-6-2/ ------------------------------------------------------ COMP 274 COMP274 COMP/274 Week 6 Programming Assignment ________________________________________ The Driving Academy Program The purpose of this lab is to give you a chance to use some of the data stream tools we have been discussing in a simple application. The assignment is to write a driving academy application that allows a user to manipulate the records of students of a driving academy. Your program will present a GUI interface which allows the user to specify student id, student name, and instructor name. It also allows the user to record grades for the midterm, final, and driving test. It displays the current overall average grade for the student. It provides a place for instructor comments to be entered and displayed. Finally, it provides buttons that permit student records to be added, fetched, updated, and deleted. There is also a button to reset the fields of the GUI to their initial condition, and there is a place where the status of each requested operation is displayed. The GUI for this program is displayed below. You will be given the graphical user interface class for this assignment. Your job is to add the necessary event handling and data management classes to make this application work and meet the requirements as detailed below. You are NOT......

Words: 1917 - Pages: 8

Comp 274 Comp274 Comp/274 - Week 7

...tutorial http://helpido.com/comp-274-week-7-3/ ----------------------------------------------------- COMP 274 COMP274 COMP/274 - Week 7 Programming Assignment ________________________________________ Documentation The objective of this part of the lab is to create documentation using Javadoc for the project from week 6. The following documentation requirements must be met. 1. All commentary must use standard JavaDoc comments and tags. 2. For every class add a class level comment including the author and the purpose of the class. 3. Where one class heavily depends on the use of an object from another class, provide a link to the other class using the @see tag. 4. For every method, add a method level comment which includes information on the purpose of the method, the method parameters, and the result returned by the method. 5. Use the javadoc command to generate HTML files for your project. 6. Use the browser to view your generated documentation to verify that all the required information for all the classes is included. Consult the document provided describing how to export JavaDoc comments from Eclipse. When your documentation is complete, turn in the following: 1. A Zip file of the directory which contains all the documentation pages. 2. A Word document containing all the source code you added JavaDoc comments to. Deployment Create a JAR file for the ScreenSaver project from week 5. The JAR file must......

Words: 321 - Pages: 2

Comp 274 Comp274 Comp/274 - Week 7

...tutorial http://helpido.com/comp-274-week-7-3/ ----------------------------------------------------- COMP 274 COMP274 COMP/274 - Week 7 Programming Assignment ________________________________________ Documentation The objective of this part of the lab is to create documentation using Javadoc for the project from week 6. The following documentation requirements must be met. 1. All commentary must use standard JavaDoc comments and tags. 2. For every class add a class level comment including the author and the purpose of the class. 3. Where one class heavily depends on the use of an object from another class, provide a link to the other class using the @see tag. 4. For every method, add a method level comment which includes information on the purpose of the method, the method parameters, and the result returned by the method. 5. Use the javadoc command to generate HTML files for your project. 6. Use the browser to view your generated documentation to verify that all the required information for all the classes is included. Consult the document provided describing how to export JavaDoc comments from Eclipse. When your documentation is complete, turn in the following: 1. A Zip file of the directory which contains all the documentation pages. 2. A Word document containing all the source code you added JavaDoc comments to. Deployment Create a JAR file for the ScreenSaver project from week 5. The JAR file must......

Words: 321 - Pages: 2

Comp274 Comp 274 Comp/274 Week 2

...HELPIDO.COM ------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-2/ ------------------------------------------------------- COMP274 COMP 274 COMP/274 Week 2 - Inheritance and Polymorphism ________________________________________ 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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program! The details of the three classes to be implemented are as follows: A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE......

Words: 763 - Pages: 4

Comp274 Comp 274 Comp/274 Week 2

...HELPIDO.COM ------------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-2/ ------------------------------------------------------- COMP274 COMP 274 COMP/274 Week 2 - Inheritance and Polymorphism ________________________________________ 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 a TaxableWorker class which contains a couple of attributes and methods common to all workers. The first derived class is a StateTaxableWorker which adds state tax information to a TaxableWorker. The second derived class is a LocalTaxableWorker which adds local tax information to a StateTaxableWorker. The test program will be structured to include a method which accepts a base class reference and demonstrates polymorphic behavior. NOTE: None of the first three classes below do any user input or console output! User input and console output are only done in the test program! The details of the three classes to be implemented are as follows: A TaxableWorker contains a name, an hourly pay rate (ie. 12.50/hr), and a federal tax rate (ie. 0.25). An explicit value constructor must be provided to set all three values. There must be mutator methods to change the values of the pay rate and the tax rate. There must be ONE......

Words: 763 - Pages: 4

Comp 274 Comp274 Comp/274 Week 3

...HELPIDO.COM -------------------------------------------------- Follow this link to get the tutorial http://helpido.com/comp-274-week-3/ -------------------------------------------------- COMP 274 COMP274 COMP/274 Week 3 Programming Assignment ________________________________________ Week 3 Programming Assignment Create Java programs for the following two problems. 1. Write a Java application to display the following GUI. At this point you are only implementing the display. We are not ready to make the calculator actually do any calculations! This program has the following requirements: 1. The size of the calculator is 250 x 250 pixels. 2. The background and foreground color of the calculator buttons must alternate in a checker board pattern as shown above. You can choose any pair of colors for your foreground and background colors. 3. The buttons should have at least 5 pixels of space between them. 4. The text on the buttons should be SanSerif size 16 and be bold. 5. Your application should be implemented in a single class. The main method of the class does nothing more than create an object of the class. The constructor of the class creates and displays the GUI. The constructor may call other methods of the class if needed. 6. The class must inherit from JFrame as the following demonstrates: public myGUI extends JFrame { … } The extends keyword specifies inheritance. Inside the class you can directly access methods of the JFrame......

Words: 444 - Pages: 2

Comp274 Comp/274 Comp 274 Week 4

...HELPIDO.COM http://helpido.com/comp-274-week-4/ COMP274 COMP/274 COMP 274 WEEK 4 PROGRAMMING ASSIGNMENT ________________________________________ Write a Java GUI application to do temperature conversions between Celcius, Fahranheit, and Kelvin. The GUI display should look something like the following: Your program must meet the following requirements: 1. Do not use any of the GUI editing capabilities of Eclipse for this assignment. Do all the GUI layout work based on what you have learned in class in the last 2 weeks. 2. The GUI and event handling setup should be done in the constructor of your GUI class or in private methods called from the constructor. 3. The display must have a label and JTextField where the user inputs a value which must appear in the upperpart of the frame as shown above. 4. There should be a set of 3 radio buttons which indicate the input scale of the value to be converted. The 3 input scale buttons must be vertically aligned on the left side of the display as shown above. 5. There should be a set of 3 radio buttons which indicate the output scale to be converted to. The 3 output scale buttons must be vertically aligned and appear on the right side of the display as shown above. 6. Event handling must be setup so that selection of any input or output button causes an event which triggers the event handling code to determine which of 9 possible conversions is needed. 7. Event handling must also respond to the user hitting the......

Words: 523 - Pages: 3

Comp 274 Comp274 Comp/274 Week 7

...tutorial http://helpido.com/comp-274-week-7-3/ ----------------------------------------------------- COMP 274 COMP274 COMP/274 - Week 7 Programming Assignment ________________________________________ Documentation The objective of this part of the lab is to create documentation using Javadoc for the project from week 6. The following documentation requirements must be met. 1. All commentary must use standard JavaDoc comments and tags. 2. For every class add a class level comment including the author and the purpose of the class. 3. Where one class heavily depends on the use of an object from another class, provide a link to the other class using the @see tag. 4. For every method, add a method level comment which includes information on the purpose of the method, the method parameters, and the result returned by the method. 5. Use the javadoc command to generate HTML files for your project. 6. Use the browser to view your generated documentation to verify that all the required information for all the classes is included. Consult the document provided describing how to export JavaDoc comments from Eclipse. When your documentation is complete, turn in the following: 1. A Zip file of the directory which contains all the documentation pages. 2. A Word document containing all the source code you added JavaDoc comments to. Deployment Create a JAR file for the ScreenSaver project from week 5. The JAR file must......

Words: 321 - Pages: 2

Hannah Quinlivan | My Ideal Business - 848 Words | Men's Shoes