Program for Age Calculator
Submitted in fulfillment of the requirements of
micro-project
Advanced Java Programming
By
“ ROSHAN ATOLE”
“TEJAS HALVANKAR”
“ATHARV ABDAR”
ROLL NO:- 43
44
45
ENROLLMENT NO:- 2209640215
2209640216
2209640217
SUBJECT INCHARGE
Mrs. Smita Kuldiwar
Computer Engineering Department
Academic Year 2024-2025
CERTIFICATE
This is to certify that the microproject
“Program for Age Calculator"
is done by
“ ROSHAN ATOLE”
“TEJAS HALVANKAR”
“ATHARV ABDAR”
is submitted for
“Advanced Java Programming”
for
the diploma in Computer Engineering to the
Maharashtra State Board of Technical Education, Mumbai
(Autonomous) (ISO-9001-2008) (ISO/IEC 27001:2013)
Subject Incharge Head of Department
(Mrs.Smita Kuldiwar) (Mrs.Smita Kuldiwar)
Program for Age Calculator
Submitted in fulfillment of the requirements
of micro-project
Advanced Java Programming
By
Process and Individual
Roll Enrollment product Presentation/ Total
No Name No assessment work (10)
(6 Marks) (4 marks)
ATOLE
43 ROSHAN 2209640215
SANJAY
TEJAS
44 2209640216
HALVANKAR
ABDAR
45 ATHARV 2209640217
SANTOSH
SUBJECT INCHARGE
(Mrs.Smita Kuldiwar)
Computer Engineering Department
Academic Year 2024-2025
COMPUTER ENGINEERING DEPARTMENT VISION AND
MISSION OF THE PROGRAMME
Vision: -
To provide technically competent and skilled diploma
computer engineers to fulfill the needs of industry and society.
Mission: -
M1:- To provide industry oriented quality education and training.
M2:- To impart and inculcate theoretical and practical knowledge.
M3:- To provide interpersonal skills and social ethics.
COMPUTER ENGINEERING DEPARTMENT PROGRAMME
OUTCOMES
PO1: Basic and Discipline specific knowledge: Apply knowledge of basic mathematics,
science and engineering fundamentals and engineering specialization to solve the engineering
problems.
PO2: Problem analysis: Identify and analyze well-defined engineering problems using
codified standard methods.
PO3: Design/ Development of solutions: Design solutions for well-defined technical
problems and assist with the design of systems components or processes to meet specified
needs.
PO4: Engineering Tools, Experimentation and Testing: Apply modern engineering
tools and appropriate technique to conduct standard tests and measurements.
PO5: Engineering practices for society, sustainability and environment: Apply
appropriate technology in context of society, sustainability, environment and ethical
practices
PO6: Project Management: Use engineering management principles individually, as a
team member or a leader to manage projects and effectively communicate about well-
defined engineering activities.
PO7: Life-long learning: Ability to analyze individual needs and engage in updating in the
context of technological changes
COMPUTER ENGINEERING DEPARTMENT PROGRAMME
EDUCATIONAL OBJECTIVES
PEO1: Provide socially responsible, environment friendly solutions
to Computer engineering related broad-based problems adapting professional ethics.
PEO2: Adapt state-of-the-art Computer engineering broad-based technologies to work in
multidisciplinary work environments.
PEO3: Solve broad-based problems individually and as a team member communicating
effectively in the world of work.
PROGRAMME SPECIFIC OUTCOMES
PSO1: Computer Software and Hardware Usage: Use state-of-the-art technologies for
operation and application of computer software and hardware.
PSO2: Computer Engineering Maintenance: Maintain computer engineering related
software and hardware systems.
Program for Age Calculator
Aim
The aim of this microproject is to develop an age calculator program that accurately computes
a user's age based on their date of birth. The program will take input in the format of
`YYYY/MM/DD`, calculate the age in years.
Course Outcomes
1. Develop programs to handle events in Java Programming.
2. Develop Programs using GUI Frameworks.
Proposed Methodology
● First, Search the topic for which you want to make a project, and then propose it to the
Subject In charge.
● After finalizing the topic, start gathering the information about your project.
● For Program Execution, write the source code of your program in any suitable IDE.
● Recheck the program with the subject in charge.
● Now, it’s time to make a report of your Selected Project.
Action Plan:
Sr. No. Detail of ac vity Plan Start Date Plan Finish Date
04-08-2024
1. Searching of Topic 06-08-2024
09-08-2024
2. Gathering informa on 13-08-2024
15-08-2024
3. Execu on of Program 22-08-2024
05-09-2024
4. Report Making 12-09-2024
Subject In-charge
(Mrs.Smita Kuldiwar)
Program for Age Calculator
Rationale
The Age Calculator project in Java serves as an excellent practical exercise for students, combining
essential programming concepts with real-world applications. It focuses on using Java's `java.time`
package, particularly `LocalDate` and `Period`, to handle date manipulation and calculations. This
project teaches user input validation and error handling through the `Scanner` class, enabling students
to manage incorrect inputs and exceptions like `DateTimeParseException`. Additionally, by
implementing logic to check for future dates, students learn to create robust and user-friendly
applications. Overall, the project reinforces foundational programming skills while emphasizing the
importance of developing efficient, error-free, and user-centric software.
Literature
The literature surrounding age calculation programs emphasizes their significance in various
applications across fields such as healthcare, finance, and event planning. Many studies highlight the
importance of accurate date handling and user input validation in programming, particularly in
languages like Java that offer robust libraries for date manipulation, such as the `java.time` package
introduced in Java 8. Research also explores the challenges and best practices in managing time-
related data, including the handling of leap years and time zones, which are critical for ensuring
precise calculations. Additionally, literature on user experience underscores the need for intuitive
interfaces that guide users in entering their birthdates correctly, thereby reducing errors and enhancing
satisfaction. Overall, the existing body of work supports the development of age calculators as
valuable tools that reinforce both technical programming skills and user-centered design principles.
Actual Methodology Followed
Topic Work Done Data Work Done By
1. Searching of topic (Hospital Management System) Everyone
2. Gathering of Informa on (Ra onale, Aim, Applica ons, ATOLE ROSHAN
etc.) SANJAY
3. Execu on of Program 1. Download Intellij.
2. Install Intellij.
TEJAS HALVANKAR
3. Run the program.
4. Get output.
4. Report Making Finaliza on of report ABDAR ATHARV
SANTOSH
Resources Required
Sr. Name of Resources Specifica on Qty. Remark
No.
1. Computer Intel i3, 4GB RAM or above 1 -
2. MS-Word Office 2007 or above 1 -
3. VS code Latest 1 -
Source Code
import java.time.LocalDate;
import java.time.Period;
import java.time.format.DateTimeParseException; // Import for handling parsing errors
import java.util.Scanner;
public class AgeCalc
{
public static void main(String args[])
{
Scanner scanner = new Scanner(System.in);
boolean keepRunning = true; // Variable to control the loop
while (keepRunning) { // Loop starts
try {
// Prompt the user to input the date of birth
System.out.print("Enter date of birth in YYYY-MM-DD format: ");
String input = scanner.nextLine(); // Reads the date of birth from the user
// Parse the input date
LocalDate dob = LocalDate.parse(input); // Attempt to parse the date input
// Check if the entered date is in the future
if (dob.isAfter(LocalDate.now())) {
System.out.println("Error: The entered date is in the future. Please enter a valid past
date.");
} else {
// Print the age if the date is valid and not in the future
System.out.println("You are " + calculateAge(dob) + " years old.");
}
} catch (DateTimeParseException e) {
// Handle invalid date format
System.out.println("Error: Invalid date format. Please enter the date in the format
YYYY-MM-DD.");
}
// Ask the user if they want to calculate another age or exit
System.out.print("Do you want to calculate another age? (yes to continue, no to exit): ");
String userChoice = scanner.nextLine().trim().toLowerCase();
if (userChoice.equals("no")) {
keepRunning = false; // Exit the loop
} else if (!userChoice.equals("yes")) {
System.out.println("Invalid choice, exiting the program.");
keepRunning = false; // Exit if input is neither 'yes' nor 'no'
}
}
// Close the scanner resource
scanner.close();
System.out.println("Program exited.");
}
// The method calculates the age
public static int calculateAge(LocalDate dob)
{
// Obtain the current date
LocalDate curDate = LocalDate.now();
// Calculate and return the difference in years
if (dob != null && curDate != null) {
return Period.between(dob, curDate).getYears();
} else {
return 0;
}
}
}
Output
Skill Developed
1. Able to develop Java Programs
2. Able to analyze and fix the errors.
3. Able to debug the program.
Application
Can be used in college and school level programs , Hospital .
Subject In-charge
(Mrs. Smita Kuldiwar)