0% found this document useful (0 votes)
19 views2 pages

Classes

The document outlines 15 programming exercises involving object-oriented concepts in Java including creating classes for employees with attributes and methods, performing operations on complex numbers and dates, adding and manipulating integer arrays, calculating areas and perimeters of shapes, implementing stacks and queues, working with points, and calculating employee pay and sorting employees by pay.

Uploaded by

Jyothi
Copyright
© © All Rights Reserved
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)
19 views2 pages

Classes

The document outlines 15 programming exercises involving object-oriented concepts in Java including creating classes for employees with attributes and methods, performing operations on complex numbers and dates, adding and manipulating integer arrays, calculating areas and perimeters of shapes, implementing stacks and queues, working with points, and calculating employee pay and sorting employees by pay.

Uploaded by

Jyothi
Copyright
© © All Rights Reserved
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/ 2

o 1.

 Create a class called Employee with the following attributes :


a.employeeID
b.lastName
c.salary
d.departmentID
e.managerID
2.  Create getter and setter methods for the above fields

3.  Create an object to store an employee details and display them using the getter methods.

4.  Write an object oriented program to perform following operations on complex numbers:

Add two complex numbers

Subtract two complex numbers

Find the conjugate of a complex number

 5. Date is represented by three integers, year, month and day. Write an object oriented Java
program for the following

           Find the difference between two dates

           Check if year is leap year

          Add an integer to a date to get a new date

 6.  Write an object oriented Java program to perform the following operations in integer arrays:

Add two arrays - corresponding elements should be added, assume the arrays
are of same size

Negate array - signs of the elements to be changed

Multiply a scalar value with all the array elements

7.Write an object-oriented program to calculate the area and perimeter of a rectangle

8. Write an object-oriented program to calculate the area and perimeter of a circle

9. Write an object oriented program to solve a quadratic equation

10. Write an object oriented Java program to implement an character Stack. Write a


Tester program to reverse the string using the character stack class.

11. Write an object oriented Java program to implement an integer Queue

12.Write an object oriented program to find following operations on point.


§Find the distance between two points

§Increment point

§Decrement point

13.Following details of employees are available: Employee ID, Employee name and
basic pay, allowances and deductions. Write an object oriented program to calculate
the gross pay and net pay.

14.Extend the above program to find the employee with the highest pay for a given
set of employee details.

15.Extend the above program to sort the employee details based on the highest pay.
s

You might also like