0% found this document useful (0 votes)
6 views23 pages

AJP Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 23

3.

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 2024-2025 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

BMI Calculator
1.0 Aims/Benefits of the Micro-Project:
The BMI Calculator Application provides users with an interactive and educational platform
to monitor their health and fitness. By offering a user-friendly interface, it allows users to
calculate their Body Mass Index (BMI), understand their weight category (underweight,
normal, overweight, or obese), and track their BMI history. The project emphasizes the
importance of health awareness while integrating practical applications of Java programming
and database management concepts. Through its engaging features, the application not only
fosters technical skill development but also encourages users to maintain a healthy lifestyle.
Overall, this tool serves as an effective blend of education and wellness promotion in a
seamless and interactive manner.
2.0 Course Outcomes Addressed:
a. Develop programs using GUI Framework (AWT and Swing).
b. Handle events of AWT and Swings components.
c. Develop programs to handle events in Java Programming.
d. Develop programs using Database.

3.0 Proposed Methodology:


1. Requirement Analysis: Identify user needs, focusing on ease of use and features like BMI
calculation, result categorization, and history tracking.
2. System Design: Develop a user-friendly GUI layout for interaction and a robust database
schema for storing user information and BMI history.
3. Technology Selection: Use Java for application logic and MySQL for database
management to ensure scalability and performance.
4. Development:
- Implement user registration and login functionality.
- Develop the BMI calculation logic with result categorization (e.g., underweight, normal,
overweight).
- Build a feature to save BMI results in the database and retrieve them for history tracking.
- Create an intuitive interface to guide users through the process seamlessly.
5. Testing: Perform unit, integration, and user acceptance testing to validate features, ensure
accuracy in BMI calculations, and gather user feedback for improvements.
4.0 Action Plan
Sr No. Details of Activity Planned Planned Name of the
Start Date Finish Date Responsible Team

Members
1 Requirement analysis 29-10-2024 30-10-2024 Anas , Yusuf
2 System Design 30-10-2024 30-10-2024 Anas , Yusuf

3 Technology Selection 31-10-2024 31-10-2024 All Members


4 Development and 01-11-2024 04-11-2024 Ayman
Testing
5 Report 05-11-2024 05-11-2024 Anas , Yusuf
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 Eclipse IDE, Run SQL Software 1
Command Line

Names of Team Members with Enrollment No.:


1. Sayed Ayman 2205690244
2. Khan Anas 2205690263
3. Khan Yusuf 2205690247
Annexure – II

Micro-Project Proposal

BMI Calculator

1.0 Rationale (Importance of the Project):


The BMI Calculator Application addresses the growing need for accessible health awareness
tools by providing a platform to calculate and track Body Mass Index (BMI). It encourages
users to monitor their health, promoting a proactive approach to wellness. Additionally, the
project reinforces the developer's expertise in Java and database management, contributing to
professional growth in software development.
2.0 Aims/Benefits of the Micro-Project:
The BMI Calculator Application offers users an interactive platform to calculate BMI,
understand their weight category, and track their history. It promotes health awareness and
self-monitoring while enhancing technical skills in Java programming and database
integration. The project supports the developer's growth by offering practical experience in
building user-centric applications, making it a valuable educational and professional
endeavor. 3.0 Course Outcomes Addressed:
a. Develop programs using GUI Framework (AWT and Swing).
b. Handle events of AWT and Swings components.
c. Develop programs to handle events in Java Programming.
d. Develop programs using Database.
4.0 Literature Review
Personalized feedback, such as BMI categorization (e.g., underweight, normal, overweight),
fosters user engagement and motivates individuals to maintain a healthy lifestyle (Deterding
et al., 2011). These tools cater to diverse user needs by providing intuitive interfaces and
accessible health insights, making wellness tracking more effective (Felder & Silverman,
1988). Furthermore, robust database management systems like MySQL ensure efficient data
storage and retrieval, enabling scalability and seamless user experience as the application
grows (Elmasri & Navathe, 2015). Integrating interactivity with strong data management is
critical for improving health awareness and user satisfaction in such applications.
5.0 Actual Method Followed (Step wise execution)
1. Requirement Analysis: Identify user needs, focusing on ease of use and features like BMI
calculation, result categorization, and history tracking.
2. System Design: Develop a user-friendly GUI layout for interaction and a robust database
schema for storing user information and BMI history.
3. Technology Selection: Use Java for application logic and MySQL for database
management to ensure scalability and performance.
4. Development:
- Implement user registration and login functionality.
- Develop the BMI calculation logic with result categorization (e.g., underweight, normal,
overweight).
- Build a feature to save BMI results in the database and retrieve them for history tracking.
- Create an intuitive interface to guide users through the process seamlessly.
5. Testing: Perform unit, integration, and user acceptance testing to validate features, ensure
accuracy in BMI calculations, and gather user feedback for improvements.
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 Eclipse IDE, Run SQL Software 1
Command Line

Skill Developed:
1. Java
2. Database
3. UI/UX
4. Problem-Solving
5. Project Management
6. Testing
7. Collaboration
Applications:
1. Education
2. Training
3. E-Learning
4. Assessment
5. Gamification
6. Self-Assessment
7. Engagement
Names of Team Members with Enrollment No.:
1. Sayed Ayman 2205690244
2. Khan Anas 2205690263
3. Khan Yusuf 2205690247
ANNEXURE II

Evaluation Sheet for Micro Project

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

Course: AJP Course Code: 22517 Semester: 5th

Title of the Project: BMI Calculator


COs Addressed by the Micro Project:

a. Develop programs using GUI Framework (AWT and Swing).


b. Handle events of AWT and Swings components.
c. Develop programs to handle events in Java Programming.
d. Develop programs using Database.
Major Learning Outcomes achieved by the students during this Project:

(a) Practical Outcome:


 Understanding Concept of components like JLabel, TextField, JButton,
JRadioButton, TextArea.
 Understanding the concept of ActionEvent.
 Understanding the connection of Database and storing the Data into it.
(b) Unit Outcomes in Cognitive Domain:
 Knowledge: Recall key concepts from quizzes.
 Comprehension: Understand and explain fundamental principles.
 Application: Apply concepts to solve practical problems.
 Analysis: Analyse questions to differentiate relevant information.
 Synthesis: Combine concepts to form a comprehensive understanding.
 Evaluation: Critically assess answers for accuracy and relevance+
(c) Questions in Affective Domain:
 Follow Safety Practices.
 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
2205690340 Shaikh Umar
2205690263 Khan Anas
2205690247 Khan Anas

(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
1. INTRODUCTION
In today’s fast-paced world, maintaining a healthy lifestyle has become a significant
challenge for many individuals. Monitoring one’s health metrics, such as Body Mass Index
(BMI), plays a crucial role in understanding physical well-being and making informed
decisions about diet and fitness. The BMI Calculator Application aims to address this need
by providing users with an interactive, accurate, and user-friendly tool for calculating their
BMI and categorizing their weight status as underweight, normal, overweight, or obese.

This application is designed with accessibility and practicality in mind. Users can easily
register or log in to access the platform, calculate their BMI, and store the results in a secure
database. The ability to track BMI history allows users to monitor their progress over time,
fostering greater awareness and accountability for their health. By combining technical
accuracy with a simple and intuitive interface, the application caters to a broad audience,
from fitness enthusiasts to individuals embarking on their health journey.

From a technical standpoint, the project leverages Java for application logic, GUI design, and
MySQL for database management. These technologies are chosen for their robustness,
scalability, and reliability, ensuring a seamless user experience. The graphical user interface
(GUI) is built using Java Swing, providing an engaging and visually appealing platform that
guides users through each step of the process, from entering their weight and height to
viewing their BMI history.

The project is not only a functional tool for users but also a valuable learning experience for
developers. It emphasizes the practical application of programming concepts such as event
handling, database connectivity, and modular design. The integration of real-world
functionality, such as secure user authentication and data storage, provides developers with
hands-on experience in building full-stack applications.

In essence, the BMI Calculator Application serves as a bridge between technology and health
awareness. It empowers users to make data-driven decisions about their well-being while
providing developers with a platform to enhance their technical skills. By addressing the dual
objectives of promoting wellness and fostering technical growth, this project exemplifies how
innovative solutions can positively impact individuals and society.

2. HARDWARE AND SOFTWARE USED

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


OS: Windows 11
Software: Eclipse IDE, Run SQL Command Line
3. ALGORITHM

1. Start
2. User Authentication
 Input: User credentials (name, email, password).
o If entered, Add the name, username and password to the Database
 Check if the user exists in the database.
o If yes, allow access.
o If no, prompt for registration.
3. Display Main Menu
 Options:
o Calculate BMI
o BMI History
4. User Chooses Option
 If Calculate BMI:
o Input: User enters Weight and Height.
o Output: Users BMI value is displayed with his/her category as
(underweight, normal, overweight or obese)
 If BMI History:
o Display the list of all BMI calculated previously by the user.
5. End
4. FLOWCHART
5. CODE

Database Connection:
import java.sql.*;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DatabaseConnection {


private static final String URL = "jdbc:mysql://localhost:3306/bmi_calculator_db";
private static final String USERNAME = "root";
private static final String PASSWORD = "admin";

public static Connection getConnection() throws SQLException {


return DriverManager.getConnection(URL, USERNAME, PASSWORD);
}
}
Login:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class LoginPage extends JFrame {


public LoginPage() {
// Set up the frame
setTitle("BMI Calci - Login");
setSize(400, 500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null); // Center the frame
setLayout(new GridBagLayout());

// Create GridBagConstraints for positioning components


GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(10, 10, 10, 10); // Padding around components
gbc.fill = GridBagConstraints.HORIZONTAL; // Stretch components horizontally

// Title label
JLabel labelTitle = new JLabel("Login");
labelTitle.setFont(new Font("Ebrima", Font.BOLD, 32));
gbc.gridx = 1;
gbc.gridy = 0;
add(labelTitle, gbc);

// Email field
gbc.gridy++;
gbc.gridx = 0;
JLabel labelEmail = new JLabel("Email");
add(labelEmail, gbc);
gbc.gridx = 1;
JTextField textEmail = new JTextField(20);
add(textEmail, gbc);

// Password field
gbc.gridy++;
gbc.gridx = 0;
JLabel labelPassword = new JLabel("Password");
add(labelPassword, gbc);
gbc.gridx = 1;
JPasswordField textPassword = new JPasswordField(20);
add(textPassword, gbc);

// Login button
gbc.gridy++;
gbc.gridx = 1;
JButton btnLogin = new JButton("Login");
add(btnLogin, gbc);

// Login button action


btnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String email = textEmail.getText();
String password = new String(textPassword.getPassword());

// Attempt to log the user in


int userId = UserService.loginUser(email, password);
if (userId != -1) { // Login successful
new BMICalculatorPage(userId).setVisible(true); // Open the BMI calculator
page
dispose(); // Close the login page
} else { // Login failed
JOptionPane.showMessageDialog(null, "Login failed. Please check your
credentials.");
}
}
});

setVisible(true); // Make the frame visible


}

public static void main(String[] args) {


SwingUtilities.invokeLater(() -> new LoginPage());
}
}
Registration:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class RegistrationPage extends JFrame {


public RegistrationPage() {
// Set up the frame
setTitle("BMI Calci - Register");
setSize(400, 500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null); // Center the frame
setLayout(new GridBagLayout());

// Create GridBagConstraints for positioning components


GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(10, 10, 10, 10); // Padding around components
gbc.fill = GridBagConstraints.HORIZONTAL; // Stretch components horizontally

// Title
gbc.gridx = 1;
gbc.gridy = 0;
JLabel labelTitle = new JLabel("Register");
labelTitle.setFont(new Font("Ebrima", Font.BOLD, 32));
add(labelTitle, gbc);

// Name field
gbc.gridy++;
gbc.gridx = 0;
JLabel labelName = new JLabel("Full Name");
add(labelName, gbc);
gbc.gridx = 1;
JTextField textName = new JTextField(20);
add(textName, gbc);

// Email field
gbc.gridy++;
gbc.gridx = 0;
JLabel labelEmail = new JLabel("Email");
add(labelEmail, gbc);
gbc.gridx = 1;
JTextField textEmail = new JTextField(20);
add(textEmail, gbc);

// Password field
gbc.gridy++;
gbc.gridx = 0;
JLabel labelPassword = new JLabel("Password");
add(labelPassword, gbc);
gbc.gridx = 1;
JPasswordField textPassword = new JPasswordField(20);
add(textPassword, gbc);

// Register button
gbc.gridy++;
gbc.gridx = 1;
JButton btnRegister = new JButton("Register");
add(btnRegister, gbc);

// Register button action


btnRegister.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String name = textName.getText();
String email = textEmail.getText();
String password = new String(textPassword.getPassword());

// Call the registerUser method


if (UserService.registerUser(name, email, password)) {
JOptionPane.showMessageDialog(null, "Registration successful! You can now
log in.");
new LoginPage(); // Redirect to LoginPage
dispose();
} else {
JOptionPane.showMessageDialog(null, "Registration failed. Email might already
be in use.");
}
}
});

// Redirect to Login Page button


gbc.gridy++;
gbc.gridx = 1;
JButton btnLoginRedirect = new JButton("Already have an account? Login here");
add(btnLoginRedirect, gbc);

// Action for login redirect


btnLoginRedirect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new LoginPage(); // Open LoginPage
dispose(); // Close RegistrationPage
}
});

setVisible(true); // Make the frame visible


}

public static void main(String[] args) {


SwingUtilities.invokeLater(() -> new RegistrationPage());
}
}
User Services (Login / Registration):
import java.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class UserService {


public static boolean registerUser(String name, String email, String password) {
String sql = "INSERT INTO users (name, email, password) VALUES (?, ?, ?)";
try (Connection conn = DatabaseConnection.getConnection();
PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setString(1, name);
stmt.setString(2, email);
stmt.setString(3, password);
stmt.executeUpdate();
return true;
} catch (SQLException e) {
e.printStackTrace();
return false;
}
}

public static int loginUser(String email, String password) {


String sql = "SELECT id FROM users WHERE email = ? AND password = ?";
try (Connection conn = DatabaseConnection.getConnection();
PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setString(1, email);
stmt.setString(2, password);
ResultSet rs = stmt.executeQuery();
if (rs.next()) {
return rs.getInt("id"); // Return user ID on successful login
}
} catch (SQLException e) {
e.printStackTrace();
}
return -1; // Indicate login failure
}
}
BMI Services (Saving BMI / Retrieving BMI):
import java.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class BMIService {


public static void saveBMI(int userId, double bmiValue) {
String sql = "INSERT INTO bmi_history (user_id, bmi_value) VALUES (?, ?)";
try (Connection conn = DatabaseConnection.getConnection();
PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, userId);
stmt.setDouble(2, bmiValue);
stmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}

public static List<String> getBMIHistory(int userId) {


List<String> history = new ArrayList<>();
String sql = "SELECT bmi_value, check_date FROM bmi_history WHERE user_id
= ?";
try (Connection conn = DatabaseConnection.getConnection();
PreparedStatement stmt = conn.prepareStatement(sql)) {
stmt.setInt(1, userId);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
double bmi = rs.getDouble("bmi_value");
String date = rs.getTimestamp("check_date").toString();
history.add("BMI: " + bmi + ", Date: " + date);
}
} catch (SQLException e) {
e.printStackTrace();
}
return history;
}
}
BMI Calculator Page:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class BMICalculatorPage extends JFrame {


private int userId;

public BMICalculatorPage(int userId) {


this.userId = userId;

setTitle("BMI Calculator");
setSize(400, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setLayout(new GridBagLayout());

GridBagConstraints gbc = new GridBagConstraints();


gbc.insets = new Insets(10, 10, 10, 10);

gbc.gridx = 0;
gbc.gridy = 0;
add(new JLabel("Weight (kg):"), gbc);
gbc.gridx = 1;
JTextField textWeight = new JTextField(20);
add(textWeight, gbc);

gbc.gridy++;
gbc.gridx = 0;
add(new JLabel("Height (m):"), gbc);
gbc.gridx = 1;
JTextField textHeight = new JTextField(20);
add(textHeight, gbc);

gbc.gridy++;
gbc.gridx = 0;
gbc.gridwidth = 2;
JLabel resultLabel = new JLabel("Your BMI will be shown here");
add(resultLabel, gbc);

gbc.gridy++;
JButton btnCalculate = new JButton("Calculate BMI");
add(btnCalculate, gbc);

gbc.gridy++;
JButton btnHistory = new JButton("View History");
add(btnHistory, gbc);

btnCalculate.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
double weight = Double.parseDouble(textWeight.getText());
double height = Double.parseDouble(textHeight.getText());
double bmi = weight / (height * height);
String bmiCategory;

// Determine BMI category


if (bmi < 18.5) {
bmiCategory = "Underweight";
} else if (bmi < 25) {
bmiCategory = "Normal";
} else if (bmi < 30) {
bmiCategory = "Overweight";
} else {
bmiCategory = "Obese";
}

resultLabel.setText("Your BMI is: " + String.format("%.2f", bmi) + " (" +


bmiCategory + ")");

// Save BMI to the database


BMIService.saveBMI(userId, bmi);
} catch (NumberFormatException ex) {
resultLabel.setText("Please enter valid numbers.");
}
}
});

btnHistory.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new HistoryPage(userId).setVisible(true);
}
});

setVisible(true);
}
}
BMI History Page:
import javax.swing.*;
import java.awt.*;
import java.util.List;

public class HistoryPage extends JFrame {


public HistoryPage(int userId) {
setTitle("BMI History");
setSize(400, 300);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setLocationRelativeTo(null);
setLayout(new BorderLayout());

JTextArea historyArea = new JTextArea();


historyArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(historyArea);
add(scrollPane, BorderLayout.CENTER);

List<String> history = BMIService.getBMIHistory(userId);


for (String record : history) {
historyArea.append(record + "\n");
}

setVisible(true);
}
}

6. OUTPUT

Fig: Registration Page


Fig: Login Page

Fig: BMI Page

Fig: History Page of User1

Fig: History Page of User2


Fig: Schema of the Database

Fig: Values that are transferred into the Database after login
7. CONCLUSION
The BMI Calculator Application is a comprehensive and interactive tool designed to promote
health awareness and empower users to take charge of their well-being. It provides an easy-
to-use platform where users can calculate their Body Mass Index (BMI), categorize their
health status (underweight, normal, overweight, or obese), and maintain a record of their BMI
history for future reference. This functionality not only makes it a practical tool for tracking
health but also encourages users to adopt healthier lifestyles by providing meaningful insights
into their physical health.

The project emphasizes simplicity and reliability, integrating a user-friendly interface with
accurate BMI calculation algorithms. The use of a robust database ensures that user data is
securely stored and efficiently managed, enabling seamless retrieval of BMI history whenever
needed. This feature adds depth to the application, allowing users to monitor their progress
over time and fostering a sense of accountability toward their health goals.

From a technical perspective, this project highlights the effective implementation of Java for
application logic and MySQL for database management. It demonstrates key programming
concepts such as GUI design with Java Swing, event handling, and secure database
connectivity. The project also reinforces best practices in software development, including
modular design, efficient coding techniques, and user-centric application building.

Furthermore, the BMI Calculator Application serves as an excellent educational tool for
developers, providing hands-on experience in creating real-world applications. It bridges the
gap between theoretical knowledge and practical application, fostering skills in problem-
solving, critical thinking, and system design.

In conclusion, this project achieves a dual purpose: promoting individual health awareness
and serving as a learning platform for developers to enhance their technical expertise. The
BMI Calculator Application is not just a utility for users but also a testament to the power of
technology in addressing everyday challenges. It stands as an example of how innovation,
when applied thoughtfully, can create meaningful impacts in both personal health and
professional growth.

8. REFERENCE

 https://chat.openai.com/
 https://www.javatpoint.com
 https://www.slideshare.net/slideshow/literature-bmi-calculator-project-report-
pdf/270146431
 www.youtube.com
 https://www.geeksforgeeks.org/establishing-jdbc-connection-in-java/
 https://www.oracle.com/mysql/technologies/mysql-enterprise-edition-
downloads.html#windows
 https://www.oracle.com/in/database/technologies/appdev/jdbc-
downloads.html

You might also like