103 Group Presentation
103 Group Presentation
PRESENTING TO :
• Dr Mohammad Manzurul Islam
• Course Title : Structured Programming
• Course Code : CSE-103
• Section : 8
• PRESENTING BY :
Jobaer Abdullah
ID : 2024-3-60-298
In this code:
int maxVehicle = 100; sets the maximum
number of vehicles that can be added to the system (up to
100).
int vehicle_count = 0; starts with a count of 0,
meaning no vehicles are currently in the system.
These variables help keep track of how many
vehicles are stored and ensure the system
doesn't exceed the maximum limit.
The welcome_Message()
function displays a decorative
welcome screen for the "Vehicle
Management System," showing a
project title and welcoming text. It
prompts the user to press any key to The login() function asks the user to enter a
continue. username and password.
The menu() function displays the main menu of the Vehicle Management System, allowing the user to choose an option by entering a number between 1 and
6.
How it works:1.Menu Display: It shows a list of options:Add a vehicle, Search for vehicles, View all vehicles, Delete a vehicle, Update password, Exit the
program.
2.User Input: It asks the user to enter their choice.
3.Action Based on Choice:Calls specific functions like addVehicleInDataBase(), searchVehicles(), etc., based on the user's input.If the choice is invalid, it
displays an error message and prompts again.
4.Repeat Until Exit: The menu keeps showing until the user selects option 6 to exit.
5.Exit Message: Displays a thank-you message when the program ends.
Explaination :
The is_Name_Valid() function checks if a given name is valid based on The is_Valid_Date() function checks if a given date is valid.
specific rules. Extract Date Components:It uses sscanf() to read the day, month, and year from the
string in the format dd/mm/yyyy.If the format is incorrect, it returns 0 (invalid).
Empty Name Check:If the name is empty (name[0] == '\0'), the
function returns 0 (invalid). Day and Month Checks:Ensures the day is between 1 and the maximum days in the
given month (days_in_month array).Ensures the month is between 1 and 12.
Character Check:It loops through each character in the name.If any Leap Year Adjustment:For February, checks if the year is a leap year (divisible by 4 but
character is not: An uppercase letter (A-Z), A lowercase letter (a-z), or not by 100, or divisible by 400).If it is a leap year, February is updated to have 29 days.
A space (' '),the function returns 0 (invalid).
Year Check: Ensures the year is between 1900 and 9999.
Valid Name:If all characters in the name are valid, the function returns Valid Date: Returns 1 if all checks pass; otherwise, returns 0.
1 (valid).
Purpose: Ensures that the input date is valid, considering the calendar rules
Purpose: This ensures that names only contain letters and spaces, (including leap years).
and are not empty.
Explaination :
• Purpose:
• The function ensures that all vehicle details are valid
before saving them, maintaining data integrity in the
database.
Explaination : searchVehicles() function lets the user search for a vehicle
by its name and displays its details if found. Here's how it works
in simple terms:
1.Display Header:
•Prints the title and section header for searching
vehicles.
2.Ask for Vehicle Name:
•Prompts the user to enter the name of the vehicle
they want to search.
3.Search Through Vehicles:
•Loops through all stored vehicles and compares
the entered name with the names in the database.
4.If Found:
•If a match is found, displays the vehicle's details:
•Vehicle ID
•Name
•Manufacturer
•Issued date
5.If Not Found:
•If no match is found, shows a message: "No
Record Found."
Explaination :
6.Return to Menu:
•Waits for the user to press a key and then returns
to the main menu.
Purpose:
This function helps the user quickly locate vehicle
details in the database by searching with the vehicle's
name.
3.Update Credentials:
•Replaces the old username and password with the new
ones.