0% found this document useful (0 votes)
23 views11 pages

Calculate Area Using Java Abstract Class

This document summarizes a micro-project completed by two students - Sneha Ohol and Madhura Pansare - to calculate the area of different shapes using an abstract class in Java. The project involved studying Java programming concepts, designing the project structure, developing the program, debugging errors, and preparing a final report. The students created an abstract class to define common properties for different shapes and implemented concrete subclasses to calculate areas. The project helped achieve outcomes related to object-oriented programming in Java.

Uploaded by

nw887059
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views11 pages

Calculate Area Using Java Abstract Class

This document summarizes a micro-project completed by two students - Sneha Ohol and Madhura Pansare - to calculate the area of different shapes using an abstract class in Java. The project involved studying Java programming concepts, designing the project structure, developing the program, debugging errors, and preparing a final report. The students created an abstract class to define common properties for different shapes and implemented concrete subclasses to calculate areas. The project helped achieve outcomes related to object-oriented programming in Java.

Uploaded by

nw887059
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MSBTE Solution App

Micro project

On

“Calculate Area Of Any Type Of Shape Using Abstract Class.”

Submitted By

Sneha Ohol (17)


Madhura Pansare (19)

P
Guided By:

AP
Ms. [Link]
n
Diploma Course in Computer Technology
tio
(As per directives of I Scheme, MSBTE)
lu
So
T E
SB
M

Sinhgad Institutes

Sinhgad Technical Education Society’s

[Link] CHAVAN POLYTECHNIC

PUNE - 411041

ACADEMIC YEAR 2020-2021

Downloaded From MSBTE Solution App


MSBTE Solution App

Maharashtra State Board of


Technical Education
Certificate

P
AP
This is to certify that [Link] Ohol with Roll No. 17 of Semester IV of
n
Diploma in Computer Technology of Institute Sou. Venutai Chavan
tio
Polytechnic (Code: 0040) has successfully completed the Micro-Project in
lu

Java Programming (22412) for the academic year 2020-2021 as prescribed in


So

the curriculum.
T E

Place: SVCP, Pune Enrollment No:


SB

Date: 10-06-2021 Exam Seat No:


M

Ms.S. Boharpi [Link] Dr.(Mrs.) M.S. Jadhav


Subject Teacher HOD Principal

Downloaded From MSBTE Solution App


MSBTE Solution App

Maharashtra State Board of


Technical Education
Certificate

P
AP
This is to certify that [Link] Pansare with Roll No. 19 of Semester IV
n
of Diploma in Computer Technology of Institute Sou. Venutai Chavan
tio
Polytechnic (Code: 0040) has successfully completed the Micro-Project in
lu

Java Programming (22412) for the academic year 2020-2021 as prescribed in


So

the curriculum.
T E

Place: SVCP, Pune Enrollment No:


SB

Date: 10-06-2021 Exam Seat No:


M

Ms.S. Boharpi [Link] Dr.(Mrs.) M.S. Jadhav


Subject Teacher HOD Principal

Downloaded From MSBTE Solution App


MSBTE Solution App

INDEX

SR NO CONTENTS PAGE NO

1 Aim of the Micro-Project 1

2 Rationale 3

3 Course Outcomes Achieved 3

4 Literature Review 4

5 Actual Methodology Followed 4

6 Actual Resources Used 5

P
7 Skills Developed 7

AP
8 Applications of Micro Project 7
n
tio
lu
So
T E
SB
M

Downloaded From MSBTE Solution App


MSBTE Solution App
Java Programming - 22412 Calculate Area Of Any Type Of Shape Using Abstract Class.

Annexure - I

A Micro-Project Proposal

1.0 Aim of the Micro-Project:

Program To Calculate Area Of Any Type Of Shape Using Abstract Class.

2.0 Intended Course Outcomes:


a) Develop programs using Object-Oriented methodology in Java.

P
AP
3.0. Proposed methodology:
I. Study the concept of JAVA programming.
n
tio
II. Study various syntax and functions of JAVA.
lu

III. Study to create small programs using JAVA.


So

IV. Make program for given criteria.


V. Prepare the final report.
T E
SB
M

Downloaded From MSBTE Solution App


MSBTE Solution App
Java Programming - 22412 Calculate Area Of Any Type Of Shape Using Abstract Class.

4.0 Action Plan:

Name of
Sr. Planned Planned
Details of Activity responsible
No. Start Date Finish Date
Team members
Identify the requirements of the
1 19/04/2021 27/04/2021 Madhura Pansare
project.

2 Design the structure of the project. 29/04/2021 07/05/2021 Sneha Ohol

Develop the program using in


3 10/05/2021 20/05/2021 Sneha Ohol
JAVA.
Debug code and eliminate errors

P
4 26/05/2021 04/06/2021 Madhura Pansare
occurred.

AP
5 Test the project. 07/06/2021 14/06/2021 Sneha Ohol

6 Prepare the final report.


n
15/06/2021 19/06/2021 Madhura Pansare
tio
lu

5.0 Resources Required:


So

S. No. Resources required Specifications


E

1 Computer system Intel(R) Pentium CPU, RAM 4 GB


T

2 Operating System Windows 10, 64 Bit Operating System


SB

3 Software’s Java JDK 15.02, Notepad++


M

6.0 Team members:

S. No. Roll. Number Name of Student


1 17 Sneha Ohol
2 19 Madhura Pansare

Downloaded From MSBTE Solution App


MSBTE Solution App
Java Programming - 22412 Calculate Area Of Any Type Of Shape Using Abstract Class.

Annexure - II

Micro-Project Report

1.0 Rationale:

Abstraction in JAVA shows only the essential attributes and hides unnecessary details
of the object from the user. In Java, abstraction is accomplished using Abstract class,
Abstract methods, and Interfaces. Abstraction helps in reducing programming
complexity and effort.
ABSTRACT CLASS is a type of class in Java, that declare one or more abstract
methods. These classes can have abstract methods as well as concrete methods. A normal

P
class cannot have abstract methods. An abstract class is a class that contains at least one

AP
abstract method.

. n
2.0 Aim of the Micro-Project:
tio
lu

Program To Calculate Area Of Any Type Of Shape Using Abstract Class.


So

3.0 Course Outcomes Achieved


T E

a) Develop programs using Object-Oriented methodology in Java.


SB
M

Downloaded From MSBTE Solution App


MSBTE Solution App
Java Programming - 22412 Calculate Area Of Any Type Of Shape Using Abstract Class.

4.0 Literature Review:


i. An abstract class may also have concrete (complete) methods.
ii. For design purpose, a class can be declared abstract even if it does not contain any abstract
methods:
iii. Reference of an abstract class can point to objects of its sub-classes thereby achieving run-
time polymorphism Ex: Shape obj = new Rectangle();
iv. A class must be compulsorily labelled abstract, if it has one or more abstract methods.

 Advantages of Abstraction:
i. Abstract class in Java is highly beneficial in writing shorter codes.
ii. Abstraction in Java avoids code duplication.
iii. Abstract classes enable code reusability.

P
iv. Changes to internal code implementation are done without affecting classes.

 Rules For Abstract Class in Java are as follows:


AP
n
tio
lu
So
T E
SB
M

Downloaded From MSBTE Solution App


MSBTE Solution App
Java Programming - 22412 Calculate Area Of Any Type Of Shape Using Abstract Class.

5.0 Actual Methodology Followed:


i. Study the concept of JAVA programming.
ii. Study various syntaxes and functions of JAVA.
iii. Study to create small programs using JAVA.
iv. Study to use Abstraction in JAVA.
v. Make program for given criteria.
vi. Prepare final report.

P
6.0 Actual Resources Used:

AP
S. No. Resources required Specifications
1 Computer system
n
Intel(R) Pentium CPU, RAM 4 GB
tio
2 Operating System Windows 10, 64 Bit Operating System
lu

3 Software’s Java JDK 15.02, Notepad++


So
E

7.0 Source code of program:


T
SB

import [Link];
M

abstract class Shape


{
abstract void area();
double area;
}

class Triangle extends Shape


{
double b=50,h=15;
void area()
{
area = (b*h)/2;
[Link]("area of Triangle -->"+area);
}
}

Downloaded From MSBTE Solution App


MSBTE Solution App
Java Programming - 22412 Calculate Area Of Any Type Of Shape Using Abstract Class.

class Rectangle extends Shape


{
double w=70,h=20;
void area()
{
area = w*h;
[Link]("area of Rectangle -->"+area);
}
}

class Circle extends Shape


{
double r=5;
void area()
{
area = [Link] * r * r;
[Link]("area of Circle -->"+area);

P
}

AP
}

class Area
{
public static void main(String [] args)
n
tio
{
Triangle t= new Triangle();
lu

Rectangle r =new Rectangle();


So

Circle c =new Circle();

[Link]();
E

[Link]();
[Link]();
T

}
SB

8.0 Output:
M

Downloaded From MSBTE Solution App


MSBTE Solution App
Java Programming - 22412 Calculate Area Of Any Type Of Shape Using Abstract Class.

9.0 Skills Developed:


During the course of this micro-project, we learnt to create a program on area of
shapes using abstract class.

a) We learnt various syntaxes of Java language.


b) We learnt to create area of shape through abstract class.
c) We also learnt abstraction of a Class.

10.0 Applications of this Micro-project:

P
This micro-project finds its application in:

AP
Abstraction in JAVA shows only the essential attributes and hides unnecessary details
of the object from the user. In Java, abstraction is accomplished using Abstract class,
Abstract methods, and Interfaces. Abstraction helps in reducing programming
n
complexity and effort.
tio
lu

11.0 Area of future Improvement:


So

For future, in a project specially for larger projects and many class files in a abstract
class can be created for different uses like in a main file for importing arithmetic
E

operations, classes can be created named arithmetic_operations in which different


T

class file for different operations like addition, subtraction, multiplication etc. can be
SB

created and for string operations package named string_operation can be developed for
operations like reversing, finding length, concatenating etc. can be made.
M

12.0 Conclusion:
We learn to calculate area of various shape. Also, we developed a java file and learnt
various syntax in java.

Downloaded From MSBTE Solution App

Common questions

Powered by AI

Abstraction in Java plays a crucial role in reducing programming complexity and effort by showing only the essential attributes and hiding unnecessary details from the user. In the context of the micro-project, abstraction is utilized to calculate the area of different shapes using an abstract class. This allows the implementation to focus on specific shape attributes and methods, leading to code reusability and simpler design. As abstract classes can contain both abstract and concrete methods, the project benefited from flexible design and avoided code duplication .

The programming environment and tools used for the project included a computer system with an Intel(R) Pentium CPU and 4 GB RAM running on Windows 10, 64-bit operating system. The software utilized Java JDK 15.02 and Notepad++ for code development. These specifications provided a suitable environment for implementing and testing the Java programs required for the project .

During the micro-project, students developed several programming skills and understanding, including the ability to create programs using the object-oriented methodology in Java, familiarity with various Java syntax, the capability to use abstract classes to calculate areas of shapes, and a deeper understanding of abstraction concepts to design more efficient and reusable code .

The use of abstract classes enhances code reusability by allowing the creation of a generic template (abstract class) that defines abstract methods to be implemented in subclass-specific ways. In the described micro-project, different shapes (Triangle, Rectangle, Circle) extend the abstract class 'Shape' and implement the 'area()' method according to their specific geometrical formulas. This design not only supports runtime polymorphism, as a reference of the abstract class 'Shape' can point to objects of its subclasses (e.g., 'Shape obj = new Rectangle();'), but also helps in maintaining code consistency and minimizing duplicate code .

The micro-project outlines specific tasks along with their planned start and finish dates. The tasks include identifying project requirements (19/04/2021 to 27/04/2021 by Madhura Pansare), designing project structure (29/04/2021 to 07/05/2021 by Sneha Ohol), developing the program in Java (10/05/2021 to 20/05/2021 by Sneha Ohol), debugging and eliminating errors (26/05/2021 to 04/06/2021 by Madhura Pansare), testing the project (07/06/2021 to 14/06/2021 by Sneha Ohol), and preparing the final report (15/06/2021 to 19/06/2021 by Madhura Pansare).

The project tackled the challenges of abstract class implementation by studying and applying Java's abstraction principles meticulously. By structuring the project to incrementally introduce and refine the use of abstract classes, it allowed for a step-by-step mastery of handling abstract methods and inheritance in Java. Moreover, debugging and testing phases ensured that any implementation issues were identified and resolved, reducing complexity and enhancing program reliability .

The methodology for the micro-project involved several steps: studying the concepts of Java programming, understanding various syntaxes and functions, creating small programs in Java, learning the use of abstraction in Java, developing the program for the specified criteria, and preparing the final report. This structured approach ensured that the abstract class concept was thoroughly explored and incrementally applied to calculate areas, thereby reinforcing learning through practice .

The practical applications of the project include demonstrating the use of abstraction in simplifying code by showing only essential attributes and hiding unnecessary details. Abstract classes and methods are utilized to reduce programming complexity and effort, and the project serves as an example of how to apply these concepts to achieve code flexibility and reusability. This concept can be extended to large-scale software development where abstraction aids in maintaining clean architecture and can be applied to various domains requiring similar architectural patterns .

The project outlines several advantages of using abstract classes in Java. These include aiding in writing shorter, more concise code, preventing code duplication, enhancing code reusability, and allowing changes to internal code implementation without affecting other classes. Abstract classes provide a base for other classes to extend and function polymorphically, which is crucial for designing flexible and maintainable code structures in software development .

For larger projects, improvements could include creating separate abstract classes or interfaces dedicated to specific functions such as arithmetic and string operations. By organizing these operations into packages, code modularity is enhanced, allowing for cleaner, more maintainable code. Furthermore, enhancing the error handling mechanisms and optimizing algorithm efficiency can be crucial for scalability. Such structures support extensibility and facilitate easier integration with other software components, fostering a more robust project architecture .

You might also like