JPR Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

A Micro - Project Report

On
“Interactive Java Pattern Generator”

Submitted on “20-03-2024”
By

1. Shaikh Umar

Under Guidance of
“Ms. Iffat Salim”

In

Three Years Diploma Program in Engineering & Technology of


Maharashtra State Board of Technical Education, Mumbai (Autonomous)
ISO 9001:2015
At
At Anjuman-I-Islam’s Abdul Razzaq Kalsekar Polytechnic
Academic Year [2023- 2024]
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI

Certificate
This is to certify that Mr. /Ms./Mrs.
Enrollment No: of Semester of Diploma in Computer
Engineering at Anjuman I Islam’s Abdul Razzak Kalsekar Polytechnic, has
completed the Micro Project satisfactorily in Subject in
the academic year 2023-2024 as per the MSBTE prescribed curriculum of I
Scheme.

Place: Enrollment No:


Date: / / Exam Seat No:

Project Guide Head of the Department Principal

Head of
Institute
Annexure – I

Micro-Project Proposal

Interactive Java Pattern Generator


1.0 Aims/Benefits of the Micro-Project:
The "Geometric Pattern Generator in Java" aims to provide an interactive tool for exploring various
geometric patterns. It serves as an educational resource for learning Java programming by
demonstrating essential concepts like loops and conditionals. With options for different pattern types,
such as rectangles, pyramids, diamonds, and triangles, users can experiment with shapes and sizes,
fostering creativity and problem-solving skills. The project offers a visual representation of patterns,
enhancing comprehension and engagement in learning. Overall, it offers both educational benefits and
a platform for creative exploration within the Java programming context.

2.0 Course Outcomes Addressed:


a. Develop programs using Object Oriented methodology in java.
b. Apply Concept of Inheritance for code reusability.
d. Implement Exception Handling.
3.0 Proposed Methodology
The proposed methodology for the project involves several steps to design an Interactive
java pattern generator.
1.Requirement Gathering: Requirement gathering involves identifying the types of geometric
patterns, user interactions, error handling, performance, platform compatibility, documentation, and
testing criteria for the "Geometric Pattern Generator in Java" project.
2.Analysis: The analysis for "Interactive Java Pattern Generator" entails assessing user needs and
system constraints to optimize pattern generation and user interaction.
3.Design: Design entails creating a robust system architecture and intuitive user interface for the
"Interactive Java Pattern Generator," ensuring seamless pattern generation and user interaction .
4.Implementation: Implementation entails translating the design specifications into
executable code, ensuring the functionality and usability of the "Interactive Java Pattern
Generator" for pattern generation and user interaction.
5.Testing and Optimization: Testing and optimization aim to verify the functionality of the
"Interactive Java Pattern Generator," addressing any issues and enhancing its performance to ensure
seamless pattern generation and user interaction.

4.0 Action Plan


Sr No. Details of Activity Planned Planned Name of the
Start Date Finish Date Responsible Team
Members
1
2
3
4
5
6
5.0 Resources Required
Sr Name of Specifications Qty. Remarks
No. Resources/Material

1 Computer System 8.00 GB Ram with 1


64 bit OS
windows 10
2 Vs Code or Notepad Software 1

Names of Team Members with Enrollment No.:


1. ………………………………………………………………

Annexure – II
Micro-Project Proposal

Interactive Java Pattern Generator

1.0 Rationale (Importance of project):


This Java project showcases fundamental programming concepts such as OOP, inheritance,
and exception handling. It efficiently generates various shape patterns based on user input,
demonstrating effective control structures and encapsulation. Its modular design promotes
code reuse and maintainability, serving as an educational tool for understanding key
programming principles in Java.
2.0 Aims/Benefits of the Micro-Project:
The micro-project offers hands-on practice with Java, reinforcing key concepts like OOP and
problem-solving through shape pattern construction. Its modular design encourages code
reusability and facilitates future enhancements, providing an effective educational tool for
mastering Java programming.
3.0 Course Outcomes Addressed:
a. Develop programs using Object Oriented methodology in java.
b. Apply Concept of Inheritance for code reusability.
d. Implement Exception Handling.
4.0 Literature Review
The micro-project showcases practical Java programming skills, echoing literature on hands-
on learning. Its modular design and emphasis on problem-solving align with pedagogical
strategies, while user input handling and exception management reflect real-world
development practices. This project provides a valuable resource for educators and learners
seeking to deepen their understanding of Java programming principles through interactive
implementation, contributing to the advancement of effective teaching methods in computer
science education.
5.0 Actual Method Followed (Step wise execution)
1.Requirement Gathering: Requirement gathering involves identifying the types of geometric
patterns, user interactions, error handling, performance, platform compatibility, documentation, and
testing criteria for the "Geometric Pattern Generator in Java" project.
2.Analysis: The analysis for "Interactive Java Pattern Generator" entails assessing user needs and
system constraints to optimize pattern generation and user interaction.
3.Design: Design entails creating a robust system architecture and intuitive user interface for the
"Interactive Java Pattern Generator," ensuring seamless pattern generation and user interaction .
4.Implementation: Implementation entails translating the design specifications into
executable code, ensuring the functionality and usability of the "Interactive Java Pattern
Generator" for pattern generation and user interaction.
5.Testing and Optimization: Testing and optimization aim to verify the functionality of the
"Interactive Java Pattern Generator," addressing any issues and enhancing its performance to ensure
seamless pattern generation and user interaction.

6.0 Actual Resources Used:


Sr Name of Specifications Qty. Remarks
No. Resources/Material

1 Computer System 16.00 GB Ram 1


with 64 bit OS
windows 11
2 VS Code Software 1

Skill Developed:
1. Java programming proficiency
2. Object-oriented programming (OOP) concepts
3. Problem-solving and algorithmic thinking
4. User input handling
5. Exception handling
6. Modular programming
7. Code reusability and extensibility
8. Logical reasoning
9. Hands-on experience with software development practices
10. Understanding of shape pattern generation techniques.
Application:
1. Console-based shape pattern generator
2. Educational tool for teaching Java programming concepts
3. Practical exercise for reinforcing OOP principles
4. Code example for demonstrating modular design
5. Resource for learning user input and exception handling in Java
6. Platform for experimenting with different shape pattern algorithms
7. Tool for enhancing problem-solving skills through pattern construction
8. Interactive Java project for self-paced learning or classroom instruction
9. Demonstration of real-world application of programming concepts
10. Prototype for potential integration into larger software projects or educational
curricula.
Names of Team Members with Enrollment No.:
1. ………………………………………………………………
ANNEXURE II

Evaluation Sheet for Micro Project

Academic Year: 2023-2024 Name of Faculty: Ms. Iffat Salim

Course: JPR Course Code: 22412 Semester: 4th

Title of the Project: Interactive Java Pattern Generator


COs Addressed by the Micro Project:

a. Develop programs using Object Oriented methodology in java.


b. Apply Concept of Inheritance for code reusability.
d. Implement Exception Handling.
Major Learning Outcomes achieved by the students during this Project:

(a) Practical Outcome:


 Understand Concept of object oriented programming
 Understand structure of Inheritance and interface
 Understand to create user defined Exception Handling
(b) Unit Outcomes in Cognitive Domain:
 Apply the identified type of inheritance for the given programming problem.
 Develop program using the specified Interface.
 Add class and inheritance to the given package.
 Distinguish the errors and exceptions (if any) in the given example.
 Develop program
(c) Questions in effective Domain:
 Follow Safety Practices.
 Practice good housekeeping.
 Demonstrate working as a leader/a team member.
 Follow ethical practices.
Comments/Suggestions about team work/leadership/inter-personal communication (if
any)

…………………………………………………………………………………………………
…………………………………………………………………………………………………
…………………………………………………………………………………………………

Marks out of 6 Marks out of 4 for


Enrollment Total out
Students Name for performance performance in
No. of 10
of group activity oral/ presentation

(Name and Signature of the Faculty)


CONTENT

Sr. No Topic
1 Introduction
2 Hardware and Software Used
3 Algorithm
4 Flowchart
5 Code
6 Output
7 Conclusion
8 Reference

.
INTRODUCTION

The "Interactive Java Pattern Generator" is a versatile software tool designed to facilitate the
creation of various geometric patterns. With an intuitive user interface and robust system
architecture, the application allows users to select from a range of pattern types and customize
parameters such as size and shape. By leveraging Java programming, the project aims to provide
a seamless experience for pattern generation and user interaction, catering to educational,
creative, and practical needs in diverse contexts.

HARDWARE AND SOFTWARE USED

Hardware: Laptop with i7 intel core,16gb Ram,512gb Storage

Software : Window 11, VS Code


ALGORITHM

Step 1: Start

Step 2: Define the main method and declare the necessary variables, including a Scanner object
to read user input.

Step 3: Print a menu of options for the user to choose from, including "1. Hollow Rectangle",
"2. Solid Rectangle", "3. Half Pyramid", "4. Diamond", and "5. Triangle".

Step 4: Read the user's choice using the Scanner object.

Step 5: Use a switch statement to determine which type of rectangle the user has chosen.

Step 6: For each case, create an instance of the appropriate class (HollowRectangle,
SolidRectangle, HalfPyramid, Diamond, or Triangle) and call its Logic() method to print the
pattern.

Step 7: If the user's choice is not valid (i.e., not between 1 and 5), throw an InvalidChoice
exception and catch it to display an error message.

Step 8: Finally, print a message to the user indicating that the program has ended.

Step 9: Stop
FLOWCHART
Start
FLOWCHART:

Define main method and declare varialbles

Print menu

Read User Choice

Switch Statement

Case 1:Hollow Rectangle

Case 2:Solid Rectangle

Case 3:Half Pyramid

Default:Invalid Choice

Print Error Message End


Message

END
CODE
import java.util.*;
interface LogicForEachOne {
public void Logic();
}
class PatternInputFromUser implements LogicForEachOne {
protected int rows;
protected int columns;
protected Scanner sc;
public void Logic() {
}
}
class HollowRectangle extends PatternInputFromUser {
public void Logic() {
sc = new Scanner(System.in);
System.out.println("Enter the number of rows");
rows = sc.nextInt();
System.out.println("Enter the number of columns");
columns = sc.nextInt();
System.out.println("Here is the Pattern in the Hollow rectangular format");
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= columns; j++) {
if (i == 1 || i == rows || j == 1 || j == columns) {
System.out.print("*");
} else {
System.out.print(" ");
}
}
System.out.println();
}
}
}
class SolidRectangle extends PatternInputFromUser {
public void Logic() {
sc = new Scanner(System.in);
System.out.println("Enter the number of rows");
rows = sc.nextInt();
System.out.println("Enter the number of columns");
columns = sc.nextInt();
System.out.println("Here is the Pattern in the Solid rectangular format");
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= columns; j++) {
System.out.print("*");
}
System.out.println();
}
}}
class HalfPyramid extends PatternInputFromUser {
public void Logic() {
sc = new Scanner(System.in);
System.out.println("Enter the number of rows");
rows = sc.nextInt();
System.out.println("Here is the Pattern in the Half Pyramid rectangular format");
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}}
class Diamond extends PatternInputFromUser {
public void Logic() {
sc = new Scanner(System.in);
System.out.println("Enter the number of rows (odd number): ");
rows = sc.nextInt();
if (rows % 2 == 0) {
System.out.println("Please enter an odd number of rows.");
return;
}
System.out.println("Here is the Pattern in the Diamond format");
int spaces = rows / 2;
int stars = 1;
for (int i = 1; i <= rows / 2 + 1; i++) {
for (int j = 1; j <= spaces; j++) {
System.out.print(" ");
}
for (int j = 1; j <= stars; j++) {
System.out.print("*");
}
System.out.println();
spaces--;
stars += 2;
}
spaces = 1;
stars = rows - 2;
for (int i = 1; i <= rows / 2; i++) {
for (int j = 1; j <= spaces; j++) {
System.out.print(" ");
}
for (int j = 1; j <= stars; j++) {
System.out.print("*");
}
System.out.println();
spaces++;
stars -= 2;
}

}
}
class Triangle extends PatternInputFromUser {
public void Logic() {
sc = new Scanner(System.in);
System.out.println("Enter the number of rows: ");
rows = sc.nextInt();
System.out.println("Here is the Pattern in the Triangle format");
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= rows - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i * 2 - 1; j++) {
System.out.print("*");
}
System.out.println();
}
}}
class InvalidChoice extends Exception {
public InvalidChoice() {
System.out.println("Invalid choice. Please choose 1 to 5.");
}
}
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int choice;
System.out.println("Choose the type of rectangle:");
System.out.println("1. Hollow Rectangle");
System.out.println("2. Solid Rectangle");
System.out.println("3. Half Pyramid");
System.out.println("4. Diamond");
System.out.println("5. Triangle");
choice = sc.nextInt();
if (choice < 1 || choice > 5) {
try {
throw new InvalidChoice();
} catch (InvalidChoice e) {
System.out.println(e + " Exception Occurs!");
}
}
switch (choice) {
case 1:
HollowRectangle hollowRectangle = new HollowRectangle();
hollowRectangle.Logic();
break;
case 2:
SolidRectangle solidRectangle = new SolidRectangle();
solidRectangle.Logic();
break;
case 3:
HalfPyramid halfPyramid = new HalfPyramid();
halfPyramid.Logic();
break;
case 4:
Diamond diamond = new Diamond();
diamond.Logic();
break;
case 5:
Triangle triangle = new Triangle();
triangle.Logic();
break;
default:
System.out.println("Something is wrong in your selection.");
}
}
}
OUTPUT

Choose the type of rectangle:


1. Hollow Rectangle
2. Solid Rectangle
3. Half Pyramid
4. Diamond
5. Triangle
4
Enter the number of rows (odd number):
7
*
***
*****
*******
*****
***
*
Choose the type of rectangle:
1. Hollow Rectangle
2. Solid Rectangle
3. Half Pyramid
4. Diamond
5. Triangle
6
Invalid choice. Please choose 1 to 5.
InvalidChoice Exception Occurs!
Something is wrong in your selection.

CONCLUSION

In summary, the "Interactive Java Pattern Generator" project successfully provides a user-
friendly platform for creating geometric patterns. Through systematic development phases, it
ensures functionality, usability, and performance. The application serves as a valuable tool for
education, creativity, and practical applications, demonstrating the power of Java programming
in solving real-world problems. Continuous improvement can further enhance its features and
relevance in various domains.

REFERENCE
 https://www.geeksforgeeks.org/interfaces-and-inheritance-in-java/

 https://www.javatpoint.com/exception-handling-in-java

You might also like