0% found this document useful (0 votes)
36 views12 pages

PWP Project

The document describes the development of a simple age calculator application using Python and Tkinter. It details the aim, methodology, design process and provides the full Python code. The application takes date of birth inputs and calculates the user's age by subtracting the birth year from the current year.

Uploaded by

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

PWP Project

The document describes the development of a simple age calculator application using Python and Tkinter. It details the aim, methodology, design process and provides the full Python code. The application takes date of birth inputs and calculates the user's age by subtracting the birth year from the current year.

Uploaded by

jayjoshi000122
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Programme: Computer Engineering Academic Year: 2023 – 2024

Course : Programming with Python Course Code: PWP- 22616

Semester : Sixth

MICRO PROJECT REPORT


ON

Simple Age Calculator


Submitted by the group of _4_ students,

Sr. Roll Enrollment Seat No


No No Full name of Student No

1 23 Joshi Jay Dilip 2100590082 392347

2 30 Kulkarni Prasanna Amol 2100590098 392358

3 81 Pawar Yash Anil 2100590180 392418

4 117 Patil Om Anil 2100590131 392383

Under the Guidance of


Ms. Surekha H. Patil
in
Three Years Diploma Programme in Engineering and Technology of
Maharashtra State Board of Technical Education, Mumbai (Autonomous)
ISO 9001: 2008 (ISO/IEC-27001:2013)
at

0059 – Shri Shivaji Vidya Prasarak Sanstha’s


Bapusaheb Shivajirao Deore Polytechnic, Vidyanagar, Deopur, Dhule-424005
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI

Certificate
This is to certify that,
Roll No Enrollment No Name Exam Seat No.
23 2100590082 Joshi Jay Dilip 392347

30 2100590098 Kulkarni Prasanna Amol 392358

81 2100590180 Pawar Yash Anil 392418

117 2100590131 Patil Om Anil 392383

students of Sixth Semester Diploma Programme in Computer Engineering at


Shri Shivaji Vidya Prasarak Sanstha’s BapuSaheb Shivajirao Deore
Polytechnic, Dhule (Institute Code : 0059), have completed the Micro Project
satisfactorily in Subject Programming With Python (22616) in the academic
year 2022–2023 as prescribed in the MSBTE curriculum of I Scheme.

Place: Dhule Date:07/04/2024

Project Guide Head of the Department Principal


Seal of Institute

Part A: Micro-Project Proposal


Simple Age Calculator
1.0 Aim of the Micro -Project:
To develop Simple age calculator in Python using TKinter Module.

2.0 Course Outcomes Addressed:


a) To display the message on the screen using python script on IDLE.
b) Develop functions for given problems.
c) Handle exceptions.
3.0 Proposed Methodology:
The aim of our project is to design a simple age calculator using the python script in the IDL.
Tkinter module is a Standard GUI (graphical user interface) to the GUI toolkit. In the project
we are going to develop a simple age calculator. We are going to use the Tkinter pakage for
developing the GUI (graphical user interface). Using Tkinter we will add various GUI
components on the form like label, button, etc…

Enter day Enter month Enter year

Calculate age
4.0 Action plan:
Sr. Details of Planned Start Planned Finish Name of Responsible
No. Activity date date Team Members

1 Data Collection 08/01/2024 27/01/2024 Jay Joshi

2 Analysis 29/01/2024 17/02/2024 Prasanna Kulkarni

3 Design 19/02/2024 09/03/2024 Yash Pawar

3 Development 11/03/2024 23/03/2024 Yash Pawar

4 Report Writing 26/03/2024 28/03/2024 Om Patil

5.0 Resource Required:

Sr. no Name of resources Specification Quantit Remark


y

1 Computer system Processor: Intel(R) Pentium(R) Dual 1 -


CPU [email protected]
RAM: 512 MB

2 Operating System OS: Windows 7(32bit) 1 -

3 Software Python 3.7.6 IDE 1 -

Names of Team Members with Roll Nos.


Roll No Name
23 Joshi Jay Dilip
30 Kulkarni Prasanna Amol

81 Pawar Yash Anil

117 Patil Om Anil

Part B: Micro-Project Report


Simple Age Calculator
1.0 Rationale:
A age calculator is a type of computer program that edits shows us our age. Age Calculator is an
amazing coding project idea for beginners. If you are new to any programming language, you
should try making an age calculator. It is an application where a user enters his date of birth as an
input, and the application gives his age as an output. So, if you want to learn how to make an age
calculator using the Python programming language, this article is for you.

2.0 Aim of the Micro-Project:


To develop Simple Age Calculator in Python using TKinter Modules.

3.0 Course Outcomes Achieved:


a) To display the message on the screen using python script on IDL.
b) Develop functions for given problems.
c) Handle exception
4.0 Actual Methodology Followed:
A. Algorithm-
Step 1: start
Step 2: import the ‘Tkinter’ package.
Step 3: define0 the ‘datetime’ module
Step 4: define ‘tkinter.messagebox’ module
Step 5: define ‘calculate_age’ function.
Step 6: inside the function, use ‘try-except’ block.
Step 7: get the current date using the ‘date.today’ function.
Step 8: get the day, month and year values.
Step 9: calculate the age.
Step 10: define the GUI window using the ‘TK()’ function
Step 11: create a canvas using the ‘Canvas()’ function with the dimensions of the
window.
Step 12: Define the style for the label, button, and entry using the 'configure()' method of
the 'ttk.Style()' class.
Step 13: Create a label for the title and add it to the canvas using the 'create_window()'
method.
Step 14: Create labels and entry fields for the day, month, and year input, and the
'calculate' button and the 'age_result' label. Add them to the canvas using the
'create_window()' method.
Step15:Bind the 'calculate_age' function to the 'command' attribute of the
'calculate_button' using the 'Button()' method.
Step 16: Run the mainloop() method of the window to display the GUI and wait for user
input.
Step17: End
B. Flowchart-
C . Program code-
age.py
from tkinter import *
from tkinter import ttk
from datetime import date
from tkinter.messagebox import showerror

def calculate_age():
try:
today = date.today()
day = int(day_entry.get())
month = int(month_entry.get())
year = int(year_entry.get())
birthdate = date(year, month, day)
age = today.year - birthdate.year - ((today.month, today.day) < (birthdate.month,
birthdate.day))
age_result.config(text='You are ' + str(age) + ' years old')
except:
showerror(title='Error', message='An error occurred while trying to ' \
'calculate age\nThe following could ' \
'be the causes:\n->Invalid input data\n->An empty field/fields\n'\
'Make sure you enter valid data and fill all the fields')

window = Tk()
window.title('Age Calculator')
window.geometry('500x260+430+300')
window.resizable(height=FALSE, width=FALSE)

canvas = Canvas(window, width=500, height=400)


canvas.pack()

label_style = ttk.Style()
label_style.configure('TLabel', foreground='#000000', font=('OCR A Extended', 14))

button_style = ttk.Style()
button_style.configure('TButton', foreground='#000000', font=('DotumChe', 16))

entry_style = ttk.Style()
entry_style.configure('TEntry', font=('Dotum', 15))
big_label = Label(window, text='AGE CALCULATOR', font=('OCR A Extended', 25))

canvas.create_window(245, 40, window=big_label)

day_label = ttk.Label(window, text='Day:', style='TLabel')


day_entry = ttk.Entry(window, width=15, style='TEntry')

month_label = ttk.Label(window, text='Month:', style='TLabel')


month_entry = ttk.Entry(window, width=15, style='TEntry')

year_label = ttk.Label(window, text='Year:', style='TLabel')


year_entry = ttk.Entry(window, width=15, style='TEntry')

calculate_button = ttk.Button(window, text='Calculate Age', style='TButton',


command=calculate_age)

age_result = ttk.Label(window, text='', style='TLabel')

canvas.create_window(114, 100, window=day_label)


canvas.create_window(130, 130, window=day_entry)

canvas.create_window(250, 100, window=month_label)


canvas.create_window(245, 130, window=month_entry)

canvas.create_window(350, 100, window=year_label)


canvas.create_window(360, 130, window=year_entry)

canvas.create_window(245, 180, window=age_result)

canvas.create_window(245, 220, window=calculate_button)

window.mainloop()
5.0 Actual Resources Used:-

Sr. no Name of resources Specification Quantit Remark


y

1 Computer system Processor: Intel(R) Pentium(R) Dual 1 -


CPU [email protected]
RAM: 512 MB

2 Operating System OS: Windows 7(32bit) 1 -

3 Software Python 3.7.6 IDE 1 -

6.0 Outputs of the Micro-Project:

Fig 6.1 Screen-Shot of Age Calculator (Enter full date of birth).


Fig 6.2 After entering the full date of birth and click on the “Calculate Age”, Age calculator
shows our age as “You are 18 years old”.

Fig 6.3.Enter the wrong date of birth and click on the “calculate age”, Age calculator shows the
this type of error.
7.0 Skill Developed/Learning outcome of this Micro-Project:

a) We learned use of Tkinter module.


b) We learned how to develop the GUI using the Tkinder.

8.0 Application of the Micro-Project:

a) Used to write the text.


b) Used to open the file , save the written file.
c) Exit from the screen .

You might also like