0% found this document useful (0 votes)
44 views1 page

Early Objects Monday

The document provides instructions for three programming assignments for a Java class. The first assignment asks students to design and implement a Pet class with attributes and responsibilities. The second asks students to create an Employee class with name, salary, set/get methods, and test it with an application. The third asks students to create a Date class with month, day, year fields and a display method, and test it.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views1 page

Early Objects Monday

The document provides instructions for three programming assignments for a Java class. The first assignment asks students to design and implement a Pet class with attributes and responsibilities. The second asks students to create an Employee class with name, salary, set/get methods, and test it with an application. The third asks students to create a Date class with month, day, year fields and a display method, and test it.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Mepco Schlenk Engineering College, Sivakasi Department of Information Technology Programs for Monday Batch (Early Objects)

1. Design a class that represents a pet object. Determine the attributes and the responsibilities. Translate your design in to a Java class. Write a driver for the class and run it. 2. 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 Employees capabilities. Create two Employee objects and display each objects yearly salary. Then give each Employee a 10% raise and display each Employees yearly salary again. Create a class called Date that includes three pieces of information as instance variablesa month (type int), a day (type int) and a year (type int). Your class should have a constructor that initializes the three instance variables and assumes that the values provided are correct. Provide a set and a get method for each instance variable. Provide a method displayDate that displays the month, day and year separated by forward slashes (/). Write a test application named DateTest that demonstrates class Dates capabilities.

3.

You might also like