Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
50 views

Practice Program (Class and Object)

This document provides a suggested list of 6 exercises for a computer engineering course on object oriented programming using Java. The exercises include writing programs to create classes like Student and Area with methods to set and get data members, print average of numbers using a class, create bank account and cube classes with methods, and overloading methods to print different data types. The goal is to practice object oriented concepts in Java like classes, objects, methods and method overloading.

Uploaded by

Soham Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Practice Program (Class and Object)

This document provides a suggested list of 6 exercises for a computer engineering course on object oriented programming using Java. The exercises include writing programs to create classes like Student and Area with methods to set and get data members, print average of numbers using a class, create bank account and cube classes with methods, and overloading methods to print different data types. The goal is to practice object oriented concepts in Java like classes, objects, methods and method overloading.

Uploaded by

Soham Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Graduation Level: Diploma of Engineering

Course: Computer Engineering


Subject Name: Object Oriented Programming using JAVA
Subject Code: 2102CS304
Semester: 3

Suggested List of Experiments / Exercises:


Ex. No. Unit No. Practical / Exercise
1 2  Write programs in Java to Create class Student with datamember name and
(Class,Object rollno and assign value of that datamember and display data.
and Method  Write a program to print the area of a rectangle by creating a class named
Overloading) 'Area' having two methods. First method named as 'setDim' takes length and
breadth of rectangle as parameters and the second method named as
'getArea' returns the area of the rectangle. Length and breadth of rectangle
are entered through keyboard.
 Write a program to Assign and print the roll number, phone number and
address of two students having names "ABC" and "XYZ" respectively by
creating two objects of class 'Student'.
 Write a program to Print the average of three numbers entered by user by
creating a class named 'Average' having a method to calculate and print the
average.
 Write a program to create class bank account having data members as
accountno and salary, create a method getvalue to get value and setvalue to
diplay data, create two object of class.
 Write a program to calculate the Power of a Number using class object and
method
 Write a program to using class Person to display name and age with method
 WAP using class Cube and calculate area using method with parameter
 Create a class named 'PrintNumber' to print various numbers of different
datatypes by creating different methods with the same name 'printn' having a
parameter for each datatype.

You might also like