Fitness Tracker(Adithya)[1]
Fitness Tracker(Adithya)[1]
(2024-2025)
PROJECT TITLE: FITNESS TRACKER MANAGEMENT
ROLL NO:
NAME:
(V.Sujith Mary)
PGT Comp Science
PRINCIPAL
CONTENTS
S.NO DESCRIPTION PG NO
1. ACKNOWLEDGEMENT 1
2. INTRODUCTION 2-12
4. OUTPUT 19-25
8. BIBLIOGRAPHY 34
ACKNOWLEDGEMENT
undertaking together.
1
INTRODUCTION
In this project, users will be able to log their daily workouts, record key
fitness metrics like calories burned, and exercise duration. The data
will be stored in a text file, allowing for easy access and management
of user records over time. The fitness tracker will feature the ability to:
2
Key Features of the Fitness Tracker Program:
1. Log Exercise:
3
6. Delete Exercise Log:
The user can safely exit the program, saving all exercise data
before the program closes.
4
SYSTEM DEVELOPMENT LIFE CYCLE (SDLC)
5
PHASES OF SYSTEM DEVELOPMENT LIFE
CYCLE
INITIATION PHASE:
ANALYSIS STAGE:
Once the planning is done, it’s time to switch to the research and analysis
stage.
In this step, you incorporate more specific data for your new system. This
includes the first system prototype drafts, market research, and an evaluation
of competitors.
6
To successfully complete the analysis and put together all the critical
information for a certain project, developers should do the following:
Generate the system requirements. A Software Requirement Specification
(SRS) document will be created at this stage.
Your DevOps team should have a high degree of input in determining the
functional and network requirements of the upcoming project.Evaluate
existing prototypes. Different prototypes should be evaluated to identify those
with the greatest potential. Conduct market research. Market research is
essential to define the pains and needs of end-consumers. In recent years,
automated NLP (natural language processing) research has been undertaken to
glean insights from customer reviews and feedback at scale. Set concrete
goals. Goals are set and allocated to the stages of the system development life
cycle. Often, these will correspond to the implementation of specific features.
Most of the information generated at this stage will be contained in the SRS.
This document shapes the strict regulations for the project and specifies the
exact software model you will eventually implement.
DESIGN STAGE:
DEVELOPMENT STAGE:
In the development stage of SDLC, the system creation process produces a
working solution. Developers write code and build the app according to the
finalized requirements and specification documents.
This stage includes both front and back-end development. DevOps engineers
are essential for allocating self-service resources to developers to streamline
the process of testing and rollout, for which CI/CD is typically employed.
This phase of the system development life cycle is often split into different
sub-stages, especially if a microservice or miniservice architecture, in which
development is broken into separate modules, is chosen.
Developers will typically use multiple tools, programming environments, and
languages (C++, PHP, Python, and others), all of which will comply with the
project specifications and requirements outlined in the SRS document.
8
Benefits of Fitness Tracker Management:
The system is also instrumental in helping users set realistic fitness goals and
track their progress. By consistently logging their activities, users can identify
patterns in their behaviour and assess whether they are meeting their fitness
objectives. For instance, the application’s ability to calculate total calories
burned, total steps taken, and average duration of exercises enables users to
monitor their overall performance. Over time, these insights help individuals
make informed adjustments to their routines, ensuring they remain aligned
with their goals. Whether someone is striving to lose weight, improve
cardiovascular health, or build muscle, the system offers a structured
9
approach to tracking progress and maintaining accountability.
Beyond its immediate benefits for individuals, the system has a broader
societal impact by promoting healthier communities. Encouraging users to
adopt regular exercise routines contributes to reducing the prevalence of
lifestyle-related diseases such as obesity, diabetes, and hypertension. The
ability to track progress and visualize improvements instills a sense of
10
responsibility and pride, encouraging users to share their success stories with
others. This ripple effect can inspire friends, family, and colleagues to
prioritize their own health, creating a positive feedback loop of well-being
and motivation within communities.
11
FLOW CHART:
12
Source code:
import mysql.connector as sql
from datetime import datetime
# Display menu
def display_menu():
print("\nFitness Tracker Menu:")
print("1. Log Exercise")
print("2. View Exercise Log")
print("3. Calculate Total Calories Burned")
print("4. Calculate Total Duration")
print("5. View Exercise Statistics")
print("6. Delete Exercise Log")
print("7. Search Exercise Log")
print("8. Sort Exercise Log")
print("9. Update Exercise Log")
print("10. Calculate Total Steps")
print("11. Exit")
print("\n")
# Log exercise
def log_exercise(cur):
try:
exercise = input("Enter exercise (e.g.,
'jogging', 'weightlifting', etc.): ")
duration = float(input("Enter duration (in
minutes): "))
calories_burned = float(input("Enter calories
burned: "))
steps = int(input("Enter steps taken: "))
13
date = input("Enter date (YYYY-MM-DD): ")
if rows:
print("\nExercise Log:")
for row in rows:
print(f"Exercise: {row[1]}, Duration:
{row[2]} minutes, Calories Burned: {row[3]}, Steps:
{row[4]}, Date: {row[5]}")
else:
print("No exercises logged yet.\n")
except Exception as e:
print(f"Error fetching exercise log: {e}\n")
if stats[0] > 0:
print(f"\nNumber of Exercises: {stats[0]}")
print(f"Total Calories Burned: {stats[1]}")
print(f"Total Duration: {stats[2]} minutes")
print(f"Total Steps: {stats[3]}")
print(f"Average Calories Burned per
Exercise: {stats[1] / stats[0]:.2f}")
print(f"Average Duration per Exercise:
{stats[2] / stats[0]:.2f} minutes")
print(f"Average Steps per Exercise:
{stats[3] / stats[0]:.2f}\n")
else:
print("No exercises logged yet.\n")
except Exception as e:
print(f"Error fetching exercise statistics: {e}\
n")
if rows:
print("\nSearch Results:")
for row in rows:
print(f"Exercise: {row[1]}, Duration:
{row[2]} minutes, Calories Burned: {row[3]}, Steps:
{row[4]}, Date: {row[5]}")
else:
print("No exercises found matching the
search term.\n")
except Exception as e:
print(f"Error searching exercise log: {e}\n")
if rows:
print("\nSorted Exercise Log:")
for row in rows:
print(f"Exercise: {row[1]}, Duration:
{row[2]} minutes, Calories Burned: {row[3]}, Steps:
{row[4]}, Date: {row[5]}")
else:
print("No exercises logged yet.\n")
except Exception as e:
print(f"Error sorting exercise log: {e}\n")
if row:
16
print(f"\nCurrent entry: Exercise: {row[1]},
Duration: {row[2]} minutes, Calories Burned: {row[3]},
Steps: {row[4]}, Date: {row[5]}")
exercise = input("Enter updated exercise: ")
duration = float(input("Enter updated
duration (in minutes): "))
calories_burned = float(input("Enter updated
calories burned: "))
steps = int(input("Enter updated steps
taken: "))
date = input("Enter updated date (YYYY-MM-
DD): ")
query = "UPDATE exercise_log SET exercise=
%s, duration=%s, calories_burned=%s, steps=%s, date=%s
WHERE id=%s"
cur.execute(query, (exercise, duration,
calories_burned, steps, date, row[0]))
print("Exercise updated successfully!")
else:
print("No matching exercise found.\n")
except Exception as e:
print(f"Error updating exercise log: {e}\n")
# Main function
def main():
conn = connect_to_database()
if not conn:
return
cur = conn.cursor()
while True:
display_menu()
choice = input("Enter your choice: ")
if choice == "1":
17
log_exercise(cur)
elif choice == "2":
view_exercise_log(cur)
elif choice == "3":
calculate_total_calories_burned(cur)
elif choice == "4":
calculate_total_duration(cur)
elif choice == "5":
view_exercise_statistics(cur)
elif choice == "6":
delete_exercise_log(cur)
elif choice == "7":
search_exercise_log(cur)
elif choice == "8":
sort_exercise_log(cur)
elif choice == "9":
update_exercise_log(cur)
elif choice == "10":
calculate_total_steps(cur)
elif choice == "11":
print("Exiting Fitness Tracker. Goodbye!")
break
else:
print("Invalid choice. Please try again.\n")
conn.commit()
cur.close()
conn.close()
18
Python Output:
19
20
21
22
23
24
25
Purpose of Testing
Types of Testing:
White Box Testing: Focuses on testing the internal code and logic of the
application.
Black Box Testing: Concentrates on verifying the application's functionality
without examining its internal structure.
White Box Testing involves analyzing the internal workings of the system. It
is also called structural or glass-box testing.
Testing Scenarios:
Step Count Functionality
Expected Result: The step count matches the number of steps entered
manually.
26
Black Box Testing
Black Box Testing focuses on the functional aspects of the application.
Testers evaluate the system by providing inputs and observing outputs
without accessing the code.
2. Input Validation
o Objective: Verify how the system handles valid and invalid
inputs.
o Test Case: Input non-numeric values into the step tracker.
o Expected Result: The system rejects invalid inputs and prompts
for valid data.
3. Data Visualization
o Objective: Test graphical representations of fitness data.
o Test Case: Input activity data and generate reports.
o Expected Result: Graphs and charts are displayed accurately.
Performance Testing:
Results:
The application passed all functional tests, demonstrating its reliability and
usability.
27
Conclusion:
An expense tracker is a powerful tool for managing personal finances and
fostering financial responsibility. By recording daily expenses and
categorizing them, users can gain valuable insights into their spending habits,
identify areas for savings, and make more informed financial decisions.
Whether the goal is to create a budget, save for a specific purpose, or simply
avoid overspending, an expense tracker provides the clarity and structure
needed to stay on track. Ultimately, it empowers users to take control of their
financial future and achieve greater financial stability.
OPERATING SYSTEM:
Windows 10 Pro
PROCESSOR:
Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz 2.90 GHz
MOTHERBOARD:
Manufacturer:Gigabyte technologies Version: x.x
SOFTWARE REQUIREMENTS:
28
1.Windows 2.My SQL 3.Python
RELATIONAL MODEL
It's based on the concept of relation. Relation is the table that consists of
rows and columns. The rows of the table are called tuple’s and the columns of
the table are called attributes. The number of rows in the table is called
cardinality. Number of columns in the table is called degree.
HIERARCHICAL MODEL
In this type of model, we have multiple records for each record. A particular
record has one parent record. No child record can exist without a parent
NETWORK MODEL:
In this, the data is represented by a collection of records and relationships are
represented by (ink or association).
CHARACTERISTICS OF DBMS:
It reduces the redundancy
Reduction of data in inconsistency
Data sharing
Data standardization
BASED ON ACCESS:
29
Sequential file
Serial file
Random (direct access) file
BASED ON STORAGE:
Text file
Binary file
INSTALLATION PROCEDURE
USE OF TECHNOLOGY
MySQL is free and open-source software under the terms of the GNU
31
General Public License, and is also available under a variety of
proprietary licenses. MySQL was owned and sponsored by the Swedish
company MySQL AB, which was bought by Sun Micro-systems (now
Oracle Corporation).
In 2010, when Oracle acquired Sun, Widenius forked the open- source
MySQL project to create Maria DB.
All databases are required to store the data, and manage the data. The way of
handling these sets of operations is called CRUD operations. Python is a user-
friendly language and it is able to get connected to any database easily via the
above ways.
Once proper installation is done, Python and that database can be connected.
Any CRUD operations can be handled easily.
Open Python
Import the packages required (import mysql.connector)
Open the connection to database
Create a cursor instance
Execute the query and store it in result set
Extract data from result set
Clean up the environment
Bibliography:
Preeti Arora
W3School
https://docs.python.org/3/tutorial/
33
34