Personal tools
You are here: Home → Comp 170 Introduction to OOP → Lab Materials → Lab3/4 → More Work for Learning
Document Actions

More Work for Learning

by Dr. William L. Honig — last modified 2006-02-09 12:13 PM

When you finish both the Lab and the Optional assignment - do this for more learning of classes and methods.

Create a class called Employee that includes three pieces of information as instance variables—a first name (type String), a last name (type String) and a monthly salary (double). Your class should have a constructor that initializes the three instance variables. Provide a set and a get method for each instance variable. If the monthly salary is not positive, set it to 0.0. Write a test application named EmployeeTest that demonstrates class Employee's capabilities. Create two Employee objects and display each object's yearly salary. Then give each Employee a 10% raise and display each Employee's yearly salary again.

« May 2026 »
Su Mo Tu We Th Fr Sa
12
3456789
10111213141516
17181920212223
24252627282930
31
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: