java project on question answer portal, Study Guides, Projects, Research of C programming

Every major buisness requires storing information of clients, our idea aims to store clients data using data structures. In this project we have aimed at providing this service as Database management of a hotel. Our program takes in username, Mobile number and email id as input, and can perform various operations such as storing, modification, displaying, and deletion. Since we are using the concept of files and linked list we are able to store data efficiently and safely without risking much da

Typology: Study Guides, Projects, Research

2019/2020

Uploaded on 11/28/2020

lila-natt
lila-natt 🇮🇳

2 documents

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
P a g e | 1
Rizvi College of Engineering
Department of Computer Engineering
Mini Project Report
On
MINI-HOTEL MANGEMENT
Second Year of Engineering
By
ROHIT NAIR (49)
MOMIN ARZAN (52)
HUZEFA ARIELWALA (55)
ABID DHANKWALA (72)
Guide:
Prof. khemani bharti jaidev
1 | P a g e
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download java project on question answer portal and more Study Guides, Projects, Research C programming in PDF only on Docsity!

Rizvi College of Engineering

Department of Computer Engineering

Mini Project Report

On

MINI-HOTEL MANGEMENT

Second Year of Engineering

By

ROHIT NAIR (49)

MOMIN ARZAN (52)

HUZEFA ARIELWALA (55)

ABID DHANKWALA (72)

Guide:

Prof. khemani bharti jaidev

Introduction

Every major buisness requires storing information of clients, our idea aims to store clients

data using data structures. In this project we have aimed at providing this service as

Database management of a hotel. Our program takes in username, Mobile number and

email id as input, and can perform various operations such as storing, modification,

displaying, and deletion. Since we are using the concept of files and linked list we are able

to store data efficiently and safely without risking much data loss.

The program involves creating an object Room using “struct” keyword and creating a file

contactdatabase.bat to store the clients data. We display the various operations that the

user has using DO-While loop. We created functions for each method and each prompt.

Using switch case we accept input and select the series of functions that has to be

executed. The storing is done using linked list and File Handling. The linked list has 3

components

i)firstc:- Contains the first record.

ii)currentc:-Points to the current record in list.

iii)newc:- contains address of new node.

The program contains the following functions:-

addNewroom(Return type:-void; Parameter:-void):- Creates a new entry in the list, the

function checks whether the entry is the first entry if so sets al nodes(i.e currentc and newc)

to firstc. Else the end of the list is obtained and the new entry is added there.

listAll(Return type:-void;Parameters:- void):- Displays the all the entries made by simply

traversing the linked list.

deleteRoom(Return type:- void;Parameters:- void):-Frees memroy allocated to the node be

usinf free().

Rizvi College of Engineering,

Department of Computer Engineering Off Carter Road, Bandra (W), Mumbai - 400050.

Certificate

This is to certify that the project report entitled “ MINI-HOTEL MANGEMENT” has been submitted

by ROHIT NAIR (49), MOMIN ARZAN (52), HUZEFA ARIELWALA (55),ABID

DHANKWALA (72) Under the guidance of Prof. khemani bharti jaidev in partial fulfilment of the

requirement for the award of the second year of Engineering in Computer Engineering from University of Mumbai. Certified By

Prof. khemani bharti jaidev

Project Guide

Index

Sr. No Title 1 2 Requirements 1.1. Hardware Requirements 1.1. Software Requirements 2.1 Algorithm 2.2 Program and Output 2.3 Conclusion 2.4 Future Scope References

3.2 Algorithm: Step 1: START Step 2: Delare Functions that are requried in program void clearInput(void), void addNewroom(void), void listAll(void) void deleteroom(void), void modifyroom(void), int findroom(void), int prompt(void), int findnum (int). Step 3: Define Struct room Containing int number ( unique room number), char name[20](contains name),char phone[15] (contains phone number), char email[20] (contains email address) also *next pointer Step 4 : create file declare file name, open file for reading, make record by using struct, pointer referencing next node, close file Step 5: print menu messages Use switch case for menu selection and call the function requried Step 6: define the functions void addNewroom(void) take the room records from the user by using struct room void listAll(void) display all the room records available in the file void deleteroom(void) show all room number then take room no. from the user that has to be delete. Remove the records of that room no void modifyroom(void) modify the room detail of specified room no entered by user int findroom(void) find room records by name specified by user step 8: STOP

3.4 Program and Output: #include <stdio.h> #include <malloc.h> #include <string.h> #include <ctype.h> /* Define Functions/ int cnum=0; void clearInput(void); void addNewroom(void); void listAll(void); void deleteroom(void); void modifyroom(void); int findroom(void); int prompt(void); int findnum (int); / Define Structures/ typedef struct room { int number; /unique account number/ char name[20]; /contains name/ char phone[15]; /contains phone number/ char email[20]; /contains email address/ struct room next; /next is used to navigate through structures./ int count; } Room; Room firstc,currentc,newc; /pointers*/

do { fflush(stdin); puts("\nWelcome To The hotel Database"); puts("-- -----------------------------"); puts("1 - Add a new room details"); puts("2 - Delete history of room details"); puts("3 - List all room and room details"); puts("4 - Modify room details"); puts("5 - Find a room detail by name"); puts("-- -----------------------------"); puts("Q - Save and quit\n"); printf("\tYour choice:"); ch = getchar(); ch = toupper(ch);/changes user input case to upper case/ switch(ch) { case '1': puts("Add a new room details \n"); fflush(stdin); addNewroom(); break; case '2': puts("Delete a room details \n"); deleteroom(); break; case '3': puts("List all room details \n");

listAll(); break; case '4': puts("Modify a room details \n"); modifyroom(); break; case '5': puts("Find a room by name\n"); findroom(); break; case 'Q': puts("Save and quit\n"); default: break; } } while(ch != 'Q'); currentc = firstc; if(currentc == NULL) return(0); datafile = fopen(filename,"w"); /open file to write/ if(datafile == NULL) { printf("Error writing to %s\n",filename); return(1); } while(currentc != NULL)

gets(currentc->email); printf("******** room details added ******** "); currentc->count=0; currentc->next = NULL; } void listAll(void) /* list all room details function/ { if(firstc==NULL) puts("There are no room details to display!"); else { printf("%6s %-20s %-15s %-15s\n","Acct#","Name","Phone","Email"); puts("------ -------------------- ------------- -------------------"); currentc=firstc; do { printf("%6d: %-20s %-15s %-20s\n",
currentc->number,
currentc->name,
currentc->phone,
currentc->email); /
prints values of number, name, phone and email/ } while((currentc=currentc->next) != NULL); } } void deleteroom(void) /delete contact function */ {

int record; struct room previousa; if(firstc==NULL) { puts("There are no room details to delete!"); return; } listAll(); / show all records*/ printf("Enter room number to delete: "); scanf("%d",&record); currentc = firstc; while(currentc != NULL) { if(currentc->number == record) { if(currentc == firstc) firstc=currentc->next; free(currentc); printf("room deatils %d deleted!\n",record); return; } else { currentc = currentc->next; } } printf("room details %d not found!\n",record); }

int findnum (int recordnum) { int record; record = recordnum; currentc = firstc; while(currentc != NULL) { if(currentc->number == record) { return 1; } else { currentc = currentc->next; } } return -1; } int findroom(void) /* find contact function/ { char buff[20]; if(firstc==NULL) { puts("There are no room details to find!"); return 1; } printf("Enter room name: "); fflush(stdin);/clears any text from the input stream*/

gets(buff); currentc = firstc; while(currentc != NULL) { if( strcmp(currentc->name, buff) == 0 ) { printf("%6s %-20s %-15s %-15s\n","Acct#","Name","Phone","Email"); /prints table titles/ printf("%6d: %-20s %-15s %-20s\n",
currentc->number,
currentc->name,
currentc->phone,
currentc->email); return 0; } else { currentc = currentc->next; } } printf("contact %s was not found!\n",buff); return 1; } int prompt(void) { char ch; fflush(stdin); printf("Update? (Y to update any other key to not)"); ch = getchar(); ch = toupper(ch);

3.5 Conclusion:

This program

helps us to understand

the concept of singly

link list, dynamic