Professional Documents
Culture Documents
Bike Rental Management System
Bike Rental Management System
Bike Rental Management System
Submitted by
BACHELOR OF TECHNOLOGY
in
INFORMATION TECHNOLOGY
JUNE 2022
FRANCIS XAVIER ENGINEERING COLLEGE
(Autonomous)
TIRUNELVELI 627 003
BONAFIDE CERTIFICATE
(95071915032)” who carried out the project work towards the completion
2. 2.1 C Language 6
2.2 CodeBlocks 6
3. Modules Used 7
4. Output Screenshot 9
6. Appendix 14
Coding 15
Reference 21
Certificates 22
ABSTRACT
Facing the growth of urban mobility in the city of Sfax and the problems of
traffic, congestion and pollution, the development of active transportation has become an
unavoidable solution.The Bike Renting System code was developed in a simple console
application, the system strictly needs user login information in order to access the system.
The user can do a set of tasks in the system, the user can register a rented bike detail, view
the Record of the Rental, remove Record of the Rental, and edit the record. The system has
all the needed functions to operate the renting system, you can easily edit, delete, view,
manage and search the renting process by filling in the customer details. The data that will
be input will be stored as a text extension file. The Bike Renting System was created in a
basic coding structure of C to teach and help the beginner to start their programming
career.
CHAPTER 1
INTRODUCTION
The Bike Rental Management system is based on the concept to generate the
rental records and to add details and update it. Here Users can Add their Bike’s Information
as well as Customer’s. The whole project is designed in ‘C’ language and different variables
and strings have been used for the development of this project. It’s easy to operate and
understand by users.The system can help you edit, delete views, manage and search for the
renting of bikes for your customer. The purpose of the Bike Renting System is to assist and
to maintain the managing of customer renting records and also to provide a platform for
users and rental bike owners in an effective and efficient manner.
TECHNOLOGIES USED
2.1 C Language
2.2 Code::Blocks
MODULES USED
In this module, the user can rent a bike by providing the following information to the
rental owner like Number of bike, Name of bike, Days, Nationality, Location, Address, Phone
Number. After providing it will be saved.
In this module, the rental owner can see the number of bikes rented from
where, when, by whom all the details in view module. It makes it easier for the owner to
make use of it.
After returning the bikes the owner is easily able to remove the bikes which
are in records.
If there are many more rental bikes, the owner can easily find the bikes by
giving the bike number. It also provides all the details about the user.
If there are any mistake in details the owner can easily edit the details by
using this module.
The owner can login and logout for some safety measures.
3.7 Working Design of Bike Rental Management System:
CHAPTER 4
OUTPUT SCREENSHOT
● We will make this platform only for bikes but, in future we can make it for
bicycles, cars, bus, trucks, etc,.. and make it beneficial for users and rental
owners .
● We will make it easier for users .
● We will add another option like History that a single user can see his rental
bikes he rented from several areas.
● We will have an idea to set the remainder to return the rental bike.
APPENDIX
CODING
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#include<windows.h>
#include<stdlib.h>
#include<time.h>
void main_menu();
void add();
void list();
void edit();
void delete1();
void search();
void gotoxy(int x, int y)
{
COORD CR;
CR.X=x;
CR.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), CR);
}
void setcolor(int ForgC)
{ WORD wColor;
HANDLE hStdOut=GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;
if(GetConsoleScreenBufferInfo(hStdOut,&csbi))
{
wColor=(csbi.wAttributes & 0xF0)+(ForgC & 0x0F);
SetConsoleTextAttribute(hStdOut,wColor);
}}
void login()
{
int a=0,i=0;
char uname[10],c=' ';
char pword[10],code[10];
char user[10]="admin";
char pass[10]="admin";
do
{ printf("\n <<<<<<<<<<<<<<<<<<<<<<<<< LOGIN FORM >>>>>>>>>>>>>>>>>>>>>>>>>> ");
printf(" \n ENTER USERNAME:-");
scanf("%s", &uname);
printf(" \n ENTER PASSWORD:-");
while(i<10)
pword[i]='\0';
i=0
if(strcmp(uname,"admin")==0 && strcmp(pword,"admin")==0)
{
printf(" \n\n\n NOW YOU ARE LOGGED IN. WELCOME TO OUR SYSTEM !!");
printf("\n\n\n\t\t\t\tPress any key to continue...");
getch();
break;
}
else
{ }
system("cls");
}
printf("\t\t| |\n");
printf("\t\t| |\n");
printf("\t\t| ----------------------------- |\n");
printf("\t\t| BIKE RENTAL SYSTEM |\n");
printf("\t\t| ----------------------------- |\n");
printf("\t\t| |\n");
printf("\t\t| |\n");
printf("\t\t| |\n");
time(&t);
char customername;
char choice;
system("cls");
while (1) // INFINITE LOOP
{
system("cls");
setcolor(55);
for(i=0;i<80;i++)
printf("-");
printf("\n");
printf(" ************************************** |MAIN MENU| **************************************
\n");
for(i=0;i<80;i++)
printf("-");
printf("\n");
setcolor(55);
printf("\t\t *Select and Enter Your Choice From Menu*:");
printf("\n\n"); printf("\
n**************************************");
printf(" \n Enter 1 ->> Rent a bike"); printf("\
n**************************************");
printf(" \n Enter 2 ->> View Rental Record"); printf("\
n**************************************");
printf(" \n Enter 3 ->> Remove Rental Record"); printf("\
n**************************************");
printf(" \n Enter 4 ->> Search Rental Record"); printf("\
n**************************************");
printf(" \n Enter 5 ->> Edit Record"); printf("\
n**************************************");
printf(" \n Enter 6 ->> Exit"); printf("\
n**************************************"); printf("\
n \n");
for(i=0;i<80;i++)
printf(">");
printf("\nCurrent date and time : %s",ctime(&t));
for(i=0;i<80;i++)
printf("<");
choice=getche();
choice=toupper(choice);
switch(choice) // SWITCH STATEMENT
{
case '1':
add();break;
case '2':
list();break;
case '3':
delete1();break;
printf("\n Enter Customer Details:");
printf("\n ");
if((f = fopen("add.txt","r+"))!=NULL)
{
ADD:
printf("\n Enter bike number\t: ");
scanf(" i%",&bikenumber);
while(fscanf(f,"%i %s %s %s %s %s %i\n", &s.bikenumber, s.name, s.address, s.phonenumber, s.nationality, s.email,
&s.period)!=EOF)
{
if(bikenumber == s.bikenumber)
{
printf("\n\tTHIS BIKE IS ALREADY ON RENT.");
goto ADD;
}
}
}
do
{
A:
printf("\n Enter Address\t\t:");
scanf("%s",s.address);
if(strlen(s.address)>20 || strlen(s.address)<2)
{
printf("\nInvalid!!\n\tThe maximum number for customer's name is less than 21 and more than 1.\n");
goto A;
}
else
{
for (i=0;i<strlen(s.address); ++i)
{
if(isalpha(s.address[i]))
{
valid = 1;
}
else
{
valid = 0;
break;
}
}
if (!valid)
{
printf("\nName contain invalid character. Please enter again.\n");
}
}
}while(!valid);
do
{
P:
printf("\n Enter Phone Number\t: ");
scanf("%s",s.phonenumber);
if (strlen(s.phonenumber)!=10 || strlen(s.phonenumber)>10)
{
printf("\nPhone number should be of 10 numbers from 0-9. Please, enter valid number.\n");
goto P;
for(i=0;i<strlen(s.nationality); i++)
{
if(isalpha(s.nationality[i]))
{
valid=1;
}
else
{
valid=0;
break;
}
}
if(!valid)
{
printf("\nThe nationality name contains only character. Please, enter again.\n");
}
}while(!valid);
do
{
printf("\nEnter Email\t\t: ");
scanf(" %s",s.email);
if(strlen(s.email)>35||strlen(s.email)<10)
{
printf("\nInvalid!!\n\tThe maximum number for customer's email is less than 31 and more than 10.\n");
}
}while(strlen(s.email)>35||strlen(s.email)<2);
do
{
printf("\nEnter Time Period(\'x\'days)\t: ");
scanf("%i",&s.period);
if(s.period>10 || s.period<=0)
{
printf("\tInvalid!!\n\tThe maximum bike rental days for customer is upto 10 days .\n");
}
}while(s.period>10 || s.period<=0);
fprintf(f,"%i %s %s %s %s %s %i\n", s.bikenumber, s.name, s.address, s.phonenumber, s.nationality, s.email, s.period);
printf("\n\n Your Desired Bike is rented successfully!!");
fclose(f);
}
printf("\n Press esc key to exit, any other key to add another customer detail:");
test=getche();
if(test==27)
main_menu();
else
add();
}
void list()
{
FILE *f;
int i, q;
if((f=fopen("add.txt","r"))==NULL)
exit(0);
system("cls");
gotoxy(1,6);
printf("BIKENUMBER ");
gotoxy(15,6);
printf("NAME ");
gotoxy(30,6);
printf("ADDRESS ");
gotoxy(45,6);
printf("PHONENUMBER ");
gotoxy(60,6);
printf("NATIONALITY ");
gotoxy(75,6);
printf("EMAIL ");
gotoxy(100,6);
printf("PERIOD \n");
for(i=0;i<110;i++)
{
printf("%s",s.email);
gotoxy(101,q);
printf("%i",s.period); q+
+;
}
printf("\n");
for(i=0;i<110;i++)
printf("-");
fclose(f);
getch();
void delete1()
{
FILE *f,*t;
int i=0;
int bikenumb;
t=fopen("temp.txt","w");
if ((f=fopen("add.txt","r"))==NULL)
{
printf("NO RECORD ADDED.");
main_menu();
}
getch();
fclose(f);
fclose(t);
main_menu();
}
else
{
printf("\n\tSuccessfully deleted.\n");
}
fclose(f);
fclose(t);
remove("add.txt");
rename("temp.txt","add.txt");
getch();
}}
void search()
{
system("cls");
FILE *f;
int bikenumber;
int flag=1;
f=fopen("add.txt","r+");
if(f==0)
{
printf("NO RECORD ADDED.");
main_menu();
}
else
{
fflush(stdin);
printf("Enter bike number of the customer to search its details: \n");
scanf("%i", &bikenumber);
while(fscanf(f,"%i %s %s %s %s %s %i\n", &s.bikenumber, s.name, s.address, s.phonenumber, s.nationality, s.email,
&s.period)!=EOF)
{
if(bikenumber==s.bikenumber)
{
flag=0;
printf("\n\tRecord Found\n");
printf("\nBike Number\t: %i",s.bikenumber);
printf("\nName\t\t: %s",s.name); printf("\
nAddress\t\t: %s",s.address); printf("\nPhone
number\t: %s",s.phonenumber); printf("\
nNationality\t: %s",s.nationality); printf("\
nEmail\t\t: %s",s.email); printf("\nPeriod\t\t:
%i",s.period);
break;
}
void edit()
{
FILE *f, *r;
int k=0;
char ed;
int bikenumber;
long int size=sizeof(s);
if((f=fopen("add.txt","r+"))==NULL)
{
printf("NO RECORD ADDED.");
main_menu();
}
else
{
r = fopen("temp.txt","a");
system("cls");
printf("Enter bike number of the customer to edit:\n\n");
scanf("%i",&bikenumber);
fflush(stdin);
while(fscanf(f,"%i %s %s %s %s %s %i\n", &s.bikenumber, s.name, s.address, s.phonenumber, s.nationality, s.email,
&s.period)!=EOF)
{
if(bikenumber==s.bikenumber)
{
k=1;
printf("\n\t*** Existing Record ***"); printf("\
nBike Number\t: %i",s.bikenumber); printf("\
nName\t\t: %s",s.name); printf("\nAddress\t\t:
%s",s.address); printf("\nPhone number\t:
%s",s.phonenumber); printf("\nNationality\t:
%s",s.nationality); printf("\nEmail\t\t:
%s",s.email); printf("\nPeriod\t\t: %i",s.period);
printf("\n\n\t*** New Record ***"); printf("\
nEnter New Name : "); printf("\
nEnter New Address : ");
scanf("%s",s.address);
printf("\nEnter New Phone number : ");
scanf("%s",s.phonenumber);
fprintf(r,"%i %s %s %s %s %s %i\n", s.bikenumber, s.name, s.address, s.phonenumber,
s.nationality, s.email, s.period);
fflush(stdin);
printf("\n\n\t\tYOUR RECORD IS SUCCESSFULLY EDITED!!!");
}
}
if(!k)
{
printf("\n\nTHE RECORD DOESN'T EXIST!!!!");
}
fclose(r);
fclose(f);
remove("add.txt");
rename("temp.txt","add.txt");
getch();
}
main_menu();
}
REFERENCE
[3] P. DeMaio and J. Gifford, “Will smart bikes succeed as public transportation in
the United States?” Journal of Public Transportation, vol. 7(2), 1-15, 2004.