File Structure Report New
File Structure Report New
BELGAUM - 590014
BACHELOR OF ENGINEERING
IN
INFORMATION SCIENCE
This Automobile Management System will help their customers to find products as per their query in less
time. User can search any particular auto-mobile using their automobile Id, automobile name .Thus, saving their
time and eliminating the process of searching manually by using Automobile Management System System.
Provides the searching facilities based on various factors. Such as Charges, Services, Automobiles, Customers.
The transactions are executed in off-line mode, hence on-line data for Charges, Booking capture and
modification is not possible.
All the fields such as Charges, Services, Customers are validated and does not take invalid values.
Editing, adding and updating of Records is improved which results in proper resource management of Charges
data.
DESCRIPTION :-The main objective of the C++ Project on Automobile Management System is to
manage the details of Customers, Booking,Automobiles, Charges, Services. It manages all the information
about Customers, Delivery, Services, Customers.
The project is totally built at administrative end and thus only the administrator is guaranteed the access.
The purpose of the project is to build an application program to reduce the manual work for managing the
Customers, Booking, Delivery, Automobiles. It tracks all the details about the Automobiles, Charges, Services.
This project describes the complete process of selling vehicle to the customer from the dealers showroom. While
executing the process, the dealer can manually maintain the vehicle business transaction type , which means, the
vehicle to sell to the customer.
K.N.S INSTITUTE OF TECHNOLOGY
BANGALORE-560 064
Department of Information Science and Engineering
CERTIFICATE
EXTERNAL Viva
1.................................. 1....................................
2.................................. 2.....................................
ACKNOWLEDGEMENT
The satisfaction that accompanies the success completion of this project would be
incomplete without the mention of the people who made it possible, without whose
constant guidance and encouragement would have made my efforts go in vain.
We consider myself privileged to express gratitude and respect towards all those who
guided me through the completion of this project.
We would also like to express my gratitude to Mr. Ateeq Ahmed, Assistant Professor,
Department of Computer Science and Engineering & Mr. Zabiulla, Assistant
Professor, Department of Information Science and Engineering, KNS INSTITUTE
OF TECHNOLOGY for giving me the support and encouragement that was necessary
for the completion of this project.
We would also convey my regards to all other Staff members and non-staff
members and for constantly Motivating and guiding us throughout this study.
Finally, we thank all my friends for their co-operation and their guidance in Bringing out
this project successful.
UTKARSH MISHRA(1KN16IS037)
5. Conclusion 34
6. Bibliography 35
Automobile Management System Requirement Analysis
CHAPTER 1
REQUIRMENT ANALYSIS
The requirement analysis specifies the requirements needed to develop a File Structure project.
Resource Requirements
• Hardware Requirements
• Software Requirements
i. Microsoft VS Code- Visual Studio Code is a source-code editor developed by Microsoft for Windows.
It includes support for debugging, embedded Git control and GitHub, syntax highlighting, intelligent code
completion, snippets, and code refactoring. It is highly customizable, allowing users to change the theme,
keyboard shortcuts, preferences, and install extensions that add additional functionality.
Visual Studio Code has out-of-the-box support for almost every major programming language.
ii. Notepad ++ - Notepad++ is a free source code editor and Notepad replacement that supports several
languages. Running in the MS Windows environment, its use is governed by GPL License. Based on a
powerful editing component Scintilla, Notepad++ is written in C++ and uses pure Win32 API and STL
which ensures a higher execution speed and smaller program size. By optimizing as many routines as
possible without losing user friendliness, Notepad++ is trying to reduce the world carbon dioxide
emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting
in a greener environment
□ Memory: 512 MB
□ RAM: 1GB
□ Mouse: Standard
CHAPTER 2
SYSTEM DESIGN
Aim: The project is on Automobile Management. Automobile Showroom is the place where customers come to
purchase their desirable automobile and pay for that. So, there is need to calculate how many automobiles are sold
and to generate the bill for the customer.
Objectives: The main objectives of system for Automobile Management System are:
In our project we have 2 scenarios. First one is the automobile manager where we will decide the service
charge and price on the automobile and can see the record of any automobile. It will also show if
automobile is available for customers. The second one is the customer who can purchase the automobiles
available and the quantity of automobile they want.
2. The Administrator will enter the information of the automobile in database and price and
service charge for each automobile.
3. The customer will come and choose the automobile they want to order and its quantity.
4. The bill calculating operator will enter the automobile Id then it will show its information and price
and the bill will be calculated and total payment will show.
6. All the automobile will be shipped and delivered to the customer. The Date on which the order
is initialized is recorded in the system.
The system design process is not a step-by-step adherence of clear procedures and, guidelines. Though,
certain clear procedures and guidelines have emerged in recent days, but still much of design work depends on
knowledge and experience of the designer. When designer starts working on system design, he will face different
type of problems. Many of these will be due to constraints imposed by the user or limitations of the hardware and
software available in the market. Sometimes, it is difficult to enumerate the complexity of the problems and solutions
thereof since the variety of likely problems is so great and no solutions are exactly similar. However, following
considerations should be kept in mind during the system designing phase:
Design Objectives
The primary objective of the design of course, is to deliver the requirements as specified in the feasibility
Reports. In general, the following design objectives should be kept in mind.
Practicality
The system must be stable and can be operated by people with average.
Efficiency
This involves accuracy, timeliness and comprehensiveness to the system output.
Cost
It is desirable to aim for a system with a minimum cost subject to the condition that it must Satisfy all
the requirements
Flexibility
The system should be modifiable depending on the changing needs of the user. Such modifications should
not entail extensive reconstructing or recreation of software. It should also be portable to different computer systems.
Security
This is very important aspect of the design and should cover areas of hardware reliability, fall back
Procedures, physical security of data and provision for detection of fraud and abuse.
System design involves first logical design and then physical construction of the system. The logical design describes
the structure and characteristics of features, like the outputs, inputs, files, database and procedures. The physical
construction, which follows the logical design, produces actual program software, files and a working system.
CHAPTER 3
PROJECT DETAILS AND IMPLEMENTATION
This Automobile Management System is a simple console application built in C++ without the
use of graphics. This project will help you understand basically two things – use of stream class and file
handling in c++ programming language.
The project is simple to understand, and the source code has been presented in an understandable manner.
The source code for this project is long, over 1000 lines. The code is complete and totally error-free, but
there are rooms for improvement.
Automobile management system is a very simple mini project in C++, built as a console application without
using graphics features. It’s just a demonstration of the use of file handling and stream class in C++
language.
The project is relatively simple to understand as there are just a few features. Understanding the source
code will give you the idea regarding file handling: how to add, remove, edit, and search data or info to
from file.
□ Display: It shows the report of all the automobiles added in Automobile management system.
□ Add, Remove or modify items: With this feature you can add, remove and modify automobile
details. In add items, you can add information or details such as automobile id, automobile
name, in stock, price, quantity, service charge, and many more.
□ Show user details: This feature allows users to see the automobiles booked and the
corresponding details given for the item while adding the item such as booking date, automobile
name and many more.
public:
int input();
void output();
string search(char key[], int mode);
void modify(int stocks, int qntity, int mode, char key[]);
void pack();
void unpack();
void Delete();
void Write();
int check_id(char key[]);
friend string check(Automobile obj, char key[]);
friend string auto_calculate(Automobile obj1, char key[]);
friend string final_calculate(Automobile obj1, char key[]);
friend void change_Stock(Automobile obj, int stocks, int qntity, char key[]);
};
class Customer
{
char customer_id[20];
char customer_name[20];
char customer_address[25];
string automobile_orders;
char quantity[5];
char automobile_id[20];
char ordered_date[25];
char buffer[500];
public:
int input();
void output();
int search(char key[]);
void modify(int mode);
void pack();
void unpack();
void Delete();
void Write();
int check_id(char key[]);
string check(Automobile ob, char key[])
{
return ob.search(key, 2);
}
string auto_calculate(Automobile obj1, char key[])
{
return obj1.search(key, 3);
}
friend void change_Stock(Automobile obj, int stocks, int qntity, char key[])
{
obj.modify(stocks, qntity, 2, key);
}
string final_calculate(Automobile obj1, char key[])
{
return obj1.search(key, 1);
}
};
// ::::::::::::::::::DELETE AND CHECK INPUT FUNCTION ON FILES:::::::::::::::::::::::::::::
int check_input(char val[])
{
int flag = 0;
for (int i = 0; i < strlen(val); i++)
{
if (!isdigit(val[i]))
{
flag = 1;
break;
}
}
return flag;
}
void delete_record_automobile()
VI Sem, Dept of ISE, KNSIT 8 2019
Automobile Management System Implementation and Project Details
{
ifstream file;
ofstream temp;
string line;
int i = 0, flag = 0;
file.open("automobile.txt");
temp.open("temp.txt");
file.seekg(0, ios::beg);
while (getline(file, line))
{
for (i = 0; i < line.length(); i++)
{
if (line[i] == '$')
flag = 1;
}
if (flag == 1)
{
flag = 0;
continue;
}
i = 0;
while (line[i] != '$' && line[i] != '#')
{
temp << line[i];
i++;
}
temp << '#';
}
if (strcmp(id, key) == 0)
{
return 1;
}
}
return 0;
}
int Automobile ::input()
{
int flag = 0;
cout << "Enter the Automobile ID:" << endl;
cin >> automobile_id;
flag = check_input(automobile_id);
if (flag == 1)
{
system("CLS");
cout << "AutomobileId should be a Number, TRY AGAIN!!!" << endl;
return 1;
}
flag = check_id(automobile_id);
if (flag == 1)
{
system("CLS");
cout << "Id Already Exist ! Try again with different id !!!!" << endl;
return 1;
}
cout << "Enter the Automobile Name:" << endl;
fflush(stdin);
gets(automobile_name);
cout << "Enter Number of Automobile in Stocks:" << endl;
cin >> in_stock;
flag = check_input(in_stock);
if (flag == 1)
{
system("CLS");
cout << "Stocks should be a Number, TRY AGAIN!!!" << endl;
return 1;
}
cout << "Enter the Price of the Automobile:" << endl;
cin >> price;
flag = check_input(price);
if (flag == 1)
{
system("CLS");
cout << "Price should be a Number, TRY AGAIN!!!" << endl;
VI Sem, Dept of ISE, KNSIT 11 2019
Automobile Management System Implementation and Project Details
return 1;
}
cout << "Enter the Service Charges:" << endl;
cin >> service_charge;
flag = check_input(service_charge);
if (flag == 1)
{
system("CLS");
cout << "ServiceCharge should be a Number, TRY AGAIN!!!" << endl;
return 1;
}
return 0;
}
void Automobile ::output()
{
istream &flush();
fstream file;
string line;
system("CLS");
file.open("automobile.txt", ios::in);
file.seekg(0, ios::beg);
if (file.is_open())
{
while (getline(file, line))
{
cout << "Error !! cant open file!!File doesn't exist!!" << endl;
}
}
void Automobile::pack()
VI Sem, Dept of ISE, KNSIT 12 2019
Automobile Management System Implementation and Project Details
strcpy(buffer, automobile_id);
strcat(buffer, "|");
strcat(buffer, automobile_name);
strcat(buffer, "|");
strcat(buffer, in_stock);
strcat(buffer, "|");
strcat(buffer, price);
strcat(buffer, "|");
strcat(buffer, service_charge);
strcat(buffer, "|");
strcat(buffer, "#");
}
void Automobile ::unpack()
{
fstream file;
string line;
char del = '$';
file.open("automobile.txt", ios::in | ios::out);
fflush(stdin);
gets(in_stock);
break;
case 3:
cout << "Enter the new Price: ";
cin >> price;
break;
case 4:
cout << "Enter the new Service Charges:";
cin >> service_charge;
break;
default:
cout << "Invalid input given";
}
}
else if (mode == 2)
{
int val_in_stock = (stocks - qntity);
ostringstream temp;
temp << val_in_stock;
std::string str = temp.str();
char *vlue = const_cast<char *>(str.c_str());
strcpy(in_stock, vlue);
if (!val_in_stock)
{
strcpy(in_stock, "0");
}
return;
}
if (!found)
cout << "\n The Id does not exist !! TRY AGAIN !!" << endl;
file.close();
delete_record_automobile();
}
string Automobile ::search(char key[], int mode)
{
istream &flush();
fstream file;
string line;
int found = 0;
file.open("automobile.txt", ios::in);
if (file.is_open())
{
while (getline(file, line))
{
for (int i = 0; i < line.length(); i++)
buffer[i] = line[i];
unpack();
if (strcmp(automobile_id, key) == 0)
{
if (mode == 0)
{
system("CLS");
cout << "Automobile Present!!! " << endl;
cout << " --------------------------------- " << endl;
cout << "Automobile ID:" << automobile_id << endl;
cout << "Automobile Name:" << automobile_name << endl;
cout << "In Stock:" << in_stock << endl;
cout << "Price: " << price << " Rs" << endl;
cout << "Service charge:" << service_charge << endl;
cout << " --------------------------------- " << endl;
found = 1;
}
if (mode == 2)
{
return in_stock;
}
else if (mode == 1)
{
unsigned long int cost, charges, total;
stringstream val1(price);
stringstream val2(service_charge);
VI Sem, Dept of ISE, KNSIT 16 2019
Automobile Management System Implementation and Project Details
return str;
}
else
{
return automobile_name;
}
}
}
}
else
{
cout << "Error!Can't open file ! file doesn't exist !!" << endl;
}
if (!found)
{
cout << "Automobile Details Not Present!!!" << endl;
return "Details not present";
}
file.close();
return 0;
}
/* :::::::::::::::::::::CUSTOMER CLASS METHODS ::::::::::::::::::::::::*/
void Customer::Delete()
{
modify(1);
}
int Customer::check_id(char key[])
{
fstream file;
string line;
char id[20];
file.open("customer.txt", ios::out | ios::in);
while (getline(file, line))
{
for (int i = 0; i < line.length(); i++)
{
if (line[i] == '|')
{
id[i] = '\0';
VI Sem, Dept of ISE, KNSIT 17 2019
Automobile Management System Implementation and Project Details
break;
}
id[i] = line[i];
}
if (strcmp(id, key) == 0)
{
return 1;
}
}
return 0;
}
int Customer ::input()
{
Automobile obj;
string in_stock;
int stocks, qntity, flag = 0;
cout << "Enter Customer ID:" << endl;
cin >> customer_id;
flag = check_input(customer_id);
if (flag == 1)
{
system("CLS");
cout << "CustomerId should be a Number, TRY AGAIN!!!" << endl;
return 1;
}
flag = check_id(customer_id);
if (flag == 1)
{
system("CLS");
cout << "Id Already Exist ! Try again with different id !!!!" << endl;
return 1;
}
}
cout << "Enter the quantity: " << endl;
cin >> quantity;
flag = check_input(quantity);
if (flag == 1)
{
system("CLS");
cout << "Quantity should be a Number, TRY AGAIN!!!" << endl;
return 1;
}
in_stock = check(obj, automobile_id);
time(&rawtime);
timeinfo = localtime(&rawtime);
return 0;
}
void Customer ::output()
{
istream &flush();
fstream file;
string line, final_cost;
Automobile obj;
unsigned long int total_cost = 0, qntity = 0;
int i = 0;
system("CLS");
file.open("customer.txt", ios::in);
if (file.is_open())
{
while (getline(file, line))
{
file.close();
}
void Customer ::Write()
{
fstream os("customer.txt", ios::out | ios::app);
os.write(buffer, strlen(buffer));
os << endl;
os.close();
}
void Customer::pack()
{
strcpy(buffer, customer_id);
strcat(buffer, "|");
strcat(buffer, customer_name);
strcat(buffer, "|");
strcat(buffer, customer_address);
strcat(buffer, "|");
strcat(buffer, automobile_id);
strcat(buffer, "|");
strcat(buffer, quantity);
strcat(buffer, "|");
strcat(buffer, ordered_date);
strcat(buffer, "|");
strcat(buffer, "#");
}
void Customer ::unpack()
{
if (strcmp(customer_id, key) == 0)
{
}
}
}
else
{
cout << "Can't open file! File doesn't exist !!!" << endl;
return 0;
}
if (!found)
cout << "Customer Details Not Present!!!" << endl;
file.close();
return 0;
}
void Customer ::modify(int mode = 0)
{
Automobile obj;
int stocks, qntity;
fstream file;
string line;
string in_stock;
int i = 0;
istream &flush();
char del = '$';
char key[30];
if (strcmp(customer_id, key) == 0)
{
else
{
Write();
break;
}
}
}
else
{
cout << "Error! Can't open file !File doesn't exist !!" << endl;
return;
}
if (!found)
{
cout << "\n The Id does not exist !! TRY AGAIN !!" << endl;
file.close();
return;
}
file.close();
delete_record_customer();
}
/*:::::::::::::::::::Automobile menu:::::::::::::::::::*/
void automobile_menu()
{
int choice = 1, flag = 0;
Automobile ob;
system("CLS");
while (choice < 6 && choice > 0)
{
char key[30];
break;
case 2:
ob.output();
break;
case 3:
cout << "Enter The Automobile ID: " << endl;
cin >> key;
ob.search(key, 0);
break;
case 4:
ob.modify();
break;
case 5:
ob.Delete();
break;
}
}
}
/*:::::::::::::::::::Customer menu:::::::::::::::::::*/
void customer_menu()
{
char key[30];
int choice = 1;
int flag = 0;
Customer custmer;
system("CLS");
while (choice < 6 && choice > 0)
{
cout << "1> Insert A Customer Info " << endl;
cout << "2> Display all Customer Info " << endl;
cout << "3> Search a Customer " << endl;
cout << "4> Modify a Customer Details " << endl;
cout << "5>Delete a Customer Details " << endl;
cout << "6> Back to Previous Section " << endl;
cout << "Enter the choice : ";
cin >> choice;
switch (choice)
{
case 1:
flag = custmer.input();
if (flag == 0)
{
custmer.pack();
custmer.Write();
VI Sem, Dept of ISE, KNSIT 27 2019
Automobile Management System Implementation and Project Details
}
break;
case 2:
custmer.output();
break;
case 3:
getch();
return
0;
}
Chapter 4
SNAPSHOTS
CHAPTER 5
CONCLUSION
To conclude the description about the project: The project, developed using C++ is based on the
requirement specification of the user and the analysis of the existing system, with the flexibility for future
enhancement.
Some rooms for improvements in this Automobile Management System project include the addition of function
limiting the values accepted by user.
Identification of the drawbacks of existing System leads to design of computerized system that will be compatible
to the existing system with the system which is more user friendly and more GUI oriented.
We have made full attempt to make the interactive program work correctly.
But as we know
“To err is human to forgive divine”, there might be some Unavoidable errors.
BIBLIOGRAPHY
□ http://www.cplusplus.com/forum/beginner/68260/
□ https://codescracker.com/cpp/cpp-date-time.htm
□ https://stackoverflow.com/questions/13540193/edit-modify-delete-of-record-from-a-random-access-
file-in-c