0% found this document useful (0 votes)
39 views

NEW - Lab Manual Template

Uploaded by

ReX CODM
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

NEW - Lab Manual Template

Uploaded by

ReX CODM
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

School of Computing Science & Engineering

(SCOPE)

Practical Record File

Course Name (Course Code)


Slot: X11+X12+X13+X14
Class no: 0000

Submitted By: Submitted to:


Name: Name Surname Dr. Anand Motwani
Reg. no.: 22BAI10000 Senior Assistant
Professor, SCSE
<Course Name>
<Course code>

Hands-on Lab Manual


Preface

This manual consists of a series of laboratory experiments to accompany


the syllabus of B. Tech. Computing Science & Engineering, VIT Bhopal
University.

The experiments are divided among following headings:

- Exercise (Objective)
- Prerequisites
- Objectives
- Underlying Concept / Theory (along with Figure if
applicable)
- Problem Statement
- Algorithm
- Coding
- Output
- Remarks
- Conclusion
- Challenges

The appropriate headings are chosen to be placed in experiments


depending on type of experiment.
Indicative List of Experiments
(All the experiments need to be done in C/C++/Java/Python Language)

Exp
Date
. Title Remark
Conducted
No.
1
2
3
4
5
6
7
8
9
10
Hands-on Lab Manual (Experiment 7)
<Classes and Objects>
Exercise (Objective) 7: To demonstrate the concept of Classes
and Objects in JAVA.

Prerequisites:
You should already be familiar with:

- Any object oriented language like C++.


- Basic constructs of language.

Objectives:
After completion of this lab student shall be able to:

- Explain Classes and Objects


- Demonstrate the Classes and Objects.
- Implement Constructor and Destructor.

Underlying Concept / Theory:


Note: Explanation of Topic related to experiment along with the example.
For example Classes and Objects in this experiment
Problem Statement:

Program 7: Write a Program to find the area of square and rectangle


using concept of Classes and Objects in JAVA.

Algorithm:
Declare classes for each nouns used in problem statement.
Define /Initialize variables and functions.
Declare class containing main ( ) method.
Create / Initialize objects.

Coding:

Program 7:

class square{
int sqarea(int side){
int area = side * side;
return(area);
}
int sqpari(int side){
int pari = 4 * side;
return(pari);
}
}
class rectangle{
int rectarea(int length,int breadth){
int area = length * breadth;
return(area);
}
int rectpari(int length,int breadth){
int pari = 2*(length + breadth);
return(pari);
}
}
public class ObjectClass{
public static void main(String args[]){
int sarea1,sarea2,pari1,pari2;
int rectarea1,rectarea2,rectpari1,rectpari2;
square sq = new square();
rectangle rect = new rectangle();
int a=20;
System.out.println("Side of first square = " + a);
sarea1 = sq.sqarea(a);
pari1 = sq.sqpari(a);
System.out.println("Area of first square = " + sarea1);
int x = 10, y = 20;
System.out.println("Length of first Rectangle = " + x);
System.out.println("Breadth of first Rectangle = " + y);
rectarea1 = rect.rectarea(x,y);
System.out.println("Area of first Rectangle = " +rectarea1);
}
}

Output:
Side of first square = 20
Area of first square = 400
Length of first Rectangle = 10
Breadth of first Rectangle = 20
Area of first Rectangle = 200

Remarks: The methods rectpari( ) & sqpari()are not used here.

Conclusion:
The objectives mentioned above are achieved successfully.

You might also like