Thursday, 8 October 2015

Hangman Game in C

Hangman Game – Project Introduction:

The most frequently used control statements in this Hangman Game are if() and if()..else sentences as well as iterative statements such as for() loop. The main purpose of the project is to illustrate use of control structures.
Features:
  • The source code of the game is easy, short, understandable and user friendly.
  • When you start the game, the game asks you to guess a character.
  • The Hangman Game in C gives five chances to guess.
  • If you are able to match the character in five guesses, you will be winner.
  • If you fail to match the character in fives guesses, you will lose the game and hanged by Hangman Game in C.
You can use this Hangman Game in C as your chapter project of control structure and it can also be used to learn use of different control structures and simple input and output statements etc.

Student Database Management System

About Student Database Management System:

Basic four features make up most of this project, but you can write your own code to add more features, and make this project more effective and better overall. You can add “Search Records” feature. Here’s a brief overview of the features:
  1. Add Records
    This feature allows you to add general information records. That includes the student’s name, course and section. All the added records in this student database management system are stored in file.
  2. List Records
    It lists all the added records from the first feature. There are some improvements you can make to this feature to make the list look more attractive.
  3. Modify Records
    This feature allows you to modify the added records. The modified records are stored in file.
  4. Delete RecordsThis feature is for deleting the added students’ information from the file.

Supermarket Billing System

About Supermarket Billing System in C++:

Supermarket billing 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.
Listed below are the key features of this project:
  • Bill Report: It shows the bill report of all the items added in supermarket billing system.
  • Add, Remove or Edit items: With this feature you can add, remove and modify item details. In add items, you can add information or details such as item no., item name, manufacturing date, price, quantity, tax percent, and many more.
  • Show item details: This feature allows users to see the items and the corresponding details given for the item while adding the item.

Banking Record System

Banking Record System Project Abstract:

File handling has been effectively used for each feature of this project. Here, I am going to describe these features in brief.
  • Add Record:
    For this feature void read_data() function has been used to add banking record into the file. It asks for information such as account number, first name, last name and balance to be entered.
  • Show/List Data:
    With the information provided in add record, the void show_data() function in this banking record system project in C++ show the record corresponding to a particular account number, first name and last name. Current balance of the account holder is displayed.
  • Search Record:
    When the function for this feature is first executed, it shows the total records in the file, and the user can then search by record number. If the record searched for is not found, the banking record system project in C++ displays the message – “Error in opening! File Not Found!!”
  • Edit Record:
    This works in similar manner to the Search feature. When the function for Edit Record is first executed, it shows the total records in the file, and the user can edit the information by providing record number. Then, the C++ project shows all the data in that record, and the user can enter any data to modify. If the record to be edited for is not found, it displays the message – “Error in opening! File Not Found!!”
  • Delete Record:
    First of all, when the function of this feature is executed, it shows all the records in the file, and the user can enter the record number to delete. If the record was not found, this banking record system project in C++ displays the message – “Error in opening! File Not Found!!”

Bookshop Management System

About Bookshop Management System:

Bookshop Management System Project in C++
Features:
Listed below are the main features of this C++ project:
1. Add Book Records: This feature allows users to add a new book to bookshop management system application. Information such as name of the book, name of the author and number of copies should be provided, and the data is stored in file.
2. Show Book Records: The add book records can be listed with this feature along with the author’s name and number of copies of the book added.
3. Check Availability: If you want to buy a particular book, this feature first checks its availability. Name, author and number of copies of the particular book is then displayed.
4. Modify Book Records: You can modify the information provided while adding a new book to bookshop management system project in C++. You can edit the book’s name, author’s name and the number of copies. All modified data are then stored in file.
5. Delete Book Records: To delete book from the file of bookshop management, this feature is used. For this the book name should be provided, and a confirmation from the user is asked before deleting the book record.

Railway Reservation System

About Railway Reservation System in C++:

Railway Reservation System Project in C++
Features:
1. Administrator mode: There are two modes in this project – the administrator mode and the user mode. For the first time you have to create Users from the Admin mode. Once users are created, you can use the same user again and again, and they will be stored in separate files.
The operations related to both these modes are quite similar in this railway reservation system project in C++. In Admin mode, you can create detail database, add details, display details, perform user management functions and display passenger details.
2. User mode: As aforementioned, at first you need to go to the administrator mode and create users. After that, you can use these users as you wish, and the information related to them will be recorded in separate files. In the user mode, you can create id database, add details and display details.
3. Train and Reservation details: In this railway reservation system project in C++, users can get both the train details and the train reservation details. The details to be provided for train are train no., train name, boarding point, destination point, no. of seats in first class and fare per ticket, no. of seats in second class and fare per ticket and date of travel.
And, in case of reservation details, the information to be provided are train no., train name, boarding point, destination point, no. of seats required, seat class specification, date of reservation, passenger category and amount to be paid. According to the no. of seats, additional information – passenger name and passenger age are to be provided. The passenger category is divided as: military, senior citizen, children and none.
4. Cancel reservation: It is somewhat similar to the feature mentioned above. This feature requires the date of cancellation in this railway reservation system project in C++. Then cancellation details can be displayed; the details here include train no., train name, boarding point, destination point, passenger class, no. of seats to be cancelled, passenger name and age, date of cancellation and the amount to be collected back.
5. Password: This railway reservation system project in C++ requires the administrator password to access the admin mode. The password is “codewithc”. If you enter the wrong password, it displays the message – “You are not permitted to login.”

Student Report Card System Project in C

About Student Report Card System:

Student Report Card System Project in C++
File handling has been used for the effective implementation of all the typical features of this project. The key features of Student Report Card System are:
1. Create student report card record: This feature creates a new student record containing his marks. For this the information to be provided are the name and roll no. of the student, and the marks obtained by him/her in 5 subjects – Physics, Chemistry, Maths, English and Computer Science.
2. Read all students report card record: The void display_all() function in this student report card system project in C++ has been used for this feature. It basically shows the progress report of all the students added in file. This feature displays the roll no. and name of all the students, the marks obtained by them in 5 subjects – Physics, Chemistry, Maths, English and Computer Science, along with the percentage and grade of each student.
3. Read specific student’s report card record: This feature is same as the one explained above, except it shows the progress report and relevant data related to a particular student.
4. Display all students’ grade report: This feature enlists all the students’ record saved in file. The grade report is displayed in a tabular form with roll no. and name of the students, marks achieved in the five subjects, and the grade and percentage obtained by them.
5. Modify student’s report card record: In student report card system project in C++, this feature is used to edit the report card record of a particular student. For this, the name and roll no. of the student is sought. Upon successful modification, the program displays the message “Record Updated”. If no record of student is found in file, it displays the message “Record not found”.
6. Delete student record: This feature deletes the report card record of a particular student; it first of all asks for the name and roll no. of the student whose record is to be deleted.

Sales Management System

Sales Management System Project Abstract:

Sales Management System Project in C++
Sales Management System is a very large and complex project. It consists of various classes and sub-classes that further consist of many features and functions related to items entry, items recording, billing, and many more. Here, I will briefly describe the classes, their sub-classes and the features under them.
Features:
1. Menu:
This class controls all the functions and is responsible for the functioning of all the features of this project. The sub-classes under this are ‘main menu’ and ‘edit menu’. The features under ‘main menu’ in this sales management system project in C++ are purchase products, list of products, edit products life and bills report. The ‘edit menu’ allows users to add, modify and delete products.
2. Product:
The ‘product’ class controls all the functions and features related to products/items. It is further divided into two sub-classes: public and private. Under ‘public’ sub-class, users can add, modify, list, purchase and delete products/items. Under the ‘private’ sub-class of sales management system project in C++, users can display, modify and delete records. Additional features in ‘private’ are returning the code of the last record in the product file, returning the record number of the given code in the product file, etc.
3. Account:
It controls all the functions in sales management system related to making bills. Like ‘product’, it is divided into ‘public’ and ‘private’ sub-classes. The ‘private’ is just for variable declaration, whereas the ‘public’ sub-class allows users to operate functions such as list bill, prepare bill, add bill, and more.

Telephone Directory System

About Telephone Directory System:

Telephone Directory System Project in C++
Features:
The features of telephone directory system are mainly related to adding, listing, searching, modifying and deleting telephone directory-related records. All these operations are done through file handling, i.e., all the added and modified data are recorded in file, and the deleted information are removed from the program file.
The information contained in the telephone directory records are the name, phone number and address of the person whose record is entered in the telephone directory system project in C. So, the simple file handling cum telephone directory operations users can perform in this project are:
•    Add telephone record
•    Show records
•    Modify record
•    Search telephone records
•    Delete record
Header Files Used:
Before you compile the source code, make sure the following header files required to run this project are there in your library folder. The project uses graphics, so the graphics.hheader file should be available to run this project. If you are going to compile the source code in Code::Blocks, you need to include graphics.h in your compiler. 
  • #include<iostream.h>
  • #include<fstream.h>
  • #include<iomanip.h>
  • #include<string.h>
  • #include<stdlib.h>
  • #include<conio.h>
  • #include<stdio.h>
  • #include<iomanip.h>
  • #include<graphics.h>
  • #include<dos.h>

Hotel Management System

Hotel Management System Project Abstract:

Hotel Management System Project in C++In the source code, I have listed the functions under different classes to help you understand the project better. Also, in this post I have briefly explained the features and functions of this hotel management project. The project may seem complex to you as it is long and utilizes graphics, so first go through the explanation provided here and try understanding and analyzing the project on your own.
1. Food menu: This function serially lists the different food items available in the hotel food menu along with their price. Here, this function also allows user to add food items or delete all food items to or from the food menu by calling the respective functions.
Add items in food menu: Users can get to this “append in food menu” function from the displaying food menu function. Here, the information to be provided are the item name to be added and the price of the food item. Then, the hotel management system project in C++ stores all the added food items in file.
Delete food menu: One room for improvement in this hotel management system program is regarding this function. After displaying the food menu from the first function, with this function user can delete all the items from the food menu, i.e, delete the food menu itself. I’d recommend you to work on this function, and modify it so that only certain items as chosen by the user can be deleted form the menu.
2. Customer bill: The customer bill consists of the room bill and the food bill functions. So, it is more like an overall hotel bill.
Food bill: This function is used to issue a bill to the customer on the basis of the item and quantity of food they ate or purchased. It asks for the name of the customer, the name of the food item and the quantity. Then, the function lists these info in a bill in tabular form. If a food item asked by the customer is not found in the file, the hotel management system project in C++ displays the message – “Item is not present.”
Room bill: Here the user needs to provided the number of the departing customer, along with the date and month of departure. Then, the room bill is displayed in a tabular form – Name, Arrival, Departure, Days in and Bill. If incorrect info regarding the customer number is provided it displays the message – “Customer is not present.”
3. Customer details: This is a very large function that consists of other sub-functions as adding, modifying and deleting customer details from the file of hotel management system project in C++. All the added, modified and deleted information regarding customer details are stored in file. Here, I will briefly describe each of these functions.
Add customer detail: The information asked for by this function are name and address of the customer, and date, month and year of the customer’s arrival.
Display customer details: This function displays the details of all the customers in the hotel. The info like customer number, name, address, room number and date are listed in a tabular form.
Modify customer detail: To modify customer detail in hotel management system project in C++, customer number is sought from the user. Then, the name, address, date, month and year of arrival of a particular customer can be modified, and all the edited data are stored in file.
Delete a customer record: For this, the user needs to provide the customer number of a particular customer whose record is to be deleted from the hotel management system file.
Delete all customer records: If the user wants to delete the records of all the customers added in the hotel management file, this function can be used.
Header Files Used:
This project utilizes 9 header files, all of which are included in Turbo C++ library file. Thegraphics.h header file has been used to make the project better, and its use is simple to understand and analyze from the source code.
If you want to run the source code in Code::Blocks make sure the header files listed below are there in your library file. The graphics.h header file is not usually present in Code::Blocks, so check this link to learn how to add graphics.h in Code::Blocks.
  • #include<iostream .h>
  • #include<conio .h>
  • #include<string .h>
  • #include<graphics .h>
  • #include<dos .h>
  • #include<stdio .h>
  • #include<fstream .h>
  • #include<iomanip .h>
  • #include<stdlib .h>
I hope this hotel management system project will serve you as a reference project to help you understand how to add, edit, modify, list and delete records from a file. Also, this project will teach you the effective use of graphics in projects. From this project, you can also learn how to add sub-functions within functions in a project to make it large and complex.

Mini Project in C Tic Tac Toe Game

Tic Tac Toe Game Development using C:

While making a Tic Tac Toe game using C language, it is important to make use of arrays. The Xs and Os are kept in different arrays, and they are passed between several functions in the code to keep track of how the game goes. With the code here you can play the game choosing either X or O against the computer.
This Tic Tac Toe C game is such that you will have to input a numerical character, from 1 to 9, to select a position for X or O into the space you want. For example: if you are playing with O and you input 2, the O will go to first row – second column. If you want to place O in third row – first column, you have to enter 7. And, it is similar for the other positions.
This has been done this way because it is just a console application without graphics designed in C language. The gotoxy function has been used to print text in any part of the screen.
Did you know?
In Tic Tac Toe game, there are 765 states of space complexities or over 25,000 possible games on those different positions.
Function Used:
I have divided this project into many functions, and below is a list of those functions. I have only described the gotoxy function in detail. Just go through the source code once, and other functions used are simple and easy to understand.
void menu() – In this mini project, this function displays the menu or welcome screen of this project. Scroll down to view the photo of the menu. With this function, you can select whether you wish to play the game with X or with O.
void go(int n)
void start_game()
void check_draw()
void draw_board()
void player_first()
void put_X_O(char ch, int pos) – This function puts one of the numerical character you input into the respective position in Tic-Tac-Toe. For example: if you are playing with X and you input 2, the X will go to first row – second column. If you want to place X in third row – first column, you have to enter 7. And, it is similar for the other positions.
void gotoxy (int x, int y) – You need to understand this function as it is one of the most important one used in Tic Tac Toe in C. This function allows you to print text in any place of the screen. Using this function in Code::Blocks requires coding, but it can be directly used in Turbo C. Here is a code for this function in Code::Blocks.
Here, COORD coord= {0,0}; is a global variable. It sets the center of axis to the top left corner of the screen.

C Library Management System

About Library Management System Project in C:

Mini Project in C Library Management System
For library management, this project considers six departments – Computer, Electrical, Civil, Electronics, Mechanical and Architecture. These departments work simultaneously with the operations mentioned above. You can add a book to the Civil section, delete a book from the Electrical section or view issued book details of the Mechanical department.
These are the functions used in this mini project:
void mainmenu(void) – This function is used to display the main menu of this project. Scroll down to Output to view the main menu.
void returnfunc(void) – Inside this function, the main menu function (mentioned above) is called when the user presses a key. With this, the user can return back to the main menu.
void addbooks(void) – This function adds books in a file. For that, you need to mention the department to which you want to add the book. The record is saved in a file. And, it is similar for the following functions as well.
void deletebooks(void)
void editbooks(void)
void searchbooks(void)
void issuebooks(void)
void viewbooks(void)
void issuerecord() – With this function, you can keep record of thestudent to whom the book has been issued.
void closeapplication(void) – This function is for closing the application.
int  getdata() – This function asks for data input from the user.
int checkid(int) – This function is used to check whether the ID of a book entered by a user exists in file or not.
void Password() – Due to this function, the user is asked to input password to run the application after it is opened. You can’t change the password upon running the application.
void gotoxy (int x, int y) – You need to understand this function as it is one of the most important one used in mini project on Library Management System in C. This function allows you to print text in any place of screen. Using this function in Code::Blocks requires coding, but it can be directly used in Turbo C. Here is a code for this function in Code::Blocks.
delay(unsigned int mseconds) – This function delays the execution. It can be used directly in Turbo C, but requires coding in Code::Blocks. The code is given below:

click here to download the code