|
Get 9,000+ Interview Questions with Answers in an eBook
C_Projects Source Codes List | Source Code Home
Program : Program for video shop data base.
/*
Description: Its a program for video shop data base .
It has 30 movies of english type.
It stores the full data of a person
using random filing.it can be used invideo selling shops.
the steps used in it are self explainatory.
*/
/******************************************************
Project of
software of movie shop(data base)
made by
pc zarrar ahmad
pc hammad hafeez
NUST
BE TELECOM ENGG
**********************************************************/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include //header files
struct videoshop
{
char name[35];
int id;
char type[20];
}film[30];
struct customer
{
char status[15];
char names[25];
char tel[9]; //variable declaration
char address[90]; //in terms of structures
}person[20];
struct person
{
char nam [20];
char tele [20];
char plc [20];
int f_id ;
char flm [20]; //for main data
char f_tp [20];
char dte [20];
char tme [20];
char stat [20];
char stat1 [20];
}p[30];
struct sport
{
int check;
char c_nam[20];
char r_d [20];
char r_t [20]; //for return movie
}d[30];
struct final
{
int arr ;
char c_n[20];
char date[20];
char time [20];
}per[30];
char op,status2[15]="not returned";
char idate[9];char itime[9],rdate[9],rtime[9];
char status1[15]="returned"; //variable declaration
int idno[60],count[30],j=0;
int c_no[20];
int che=0;
void s_customer_no() //function of search by customer no
{
clrscr();
ifstream infile;
infile.open("file.txt",ios::binary); //opens a file and reads
infile.seekg(0,ios::end);
int n= (int)infile.tellg()/ sizeof(person);
cout<<"there are "<>key;
int c1,c2;
c1=0,c2=0;
for (int j=0;j>vidno;
ifstream infile;
infile.open("file.txt",ios::binary);
infile.seekg(0,ios::end);
int z= (int)infile.tellg()/ sizeof(person);
int k=0,max=0;
for (int j=0;j>cid; // inputs customer data
cout<<"\n\nEnter the customers name : ";
gets(cnam);
ifstream infile;
infile.open("file.txt",ios::binary);
infile.seekg(0,ios::end);
int n= (int)infile.tellg()/ sizeof(person); //reads from specified file
ofstream out;
out.open("fold.txt",ios::app|ios::binary);
ifstream in;
in.open("fold.txt",ios::binary);
in.seekg(0,ios::end);
int s=(int)in.tellg()/ sizeof(sport);
if(s>0)
{
for (int l=0;l 1) move--;
}
else if (ch == 'P')
{
if (move == 6) move = 1;
else if (move < 6) move++;
}
c1 = c2 = c3 = c4 = c5 = c6 = 15;
c1b = c2b = c3b = c4b = c5b = c6b = 0;
if (move == 1) {c1 = 14; c1b = 9;}
else if (move == 2) {c2 = 14; c2b = 9; }
else if (move == 3) {c3 = 14; c3b = 9; }
else if (move == 4) {c4 = 14; c4b = 9; } // main menu
else if (move == 5) {c5 = 14; c5b = 9; } // displays total options of
else {c6 = 14; c6b = 9; // data base
}
textcolor(c1); textbackground(c1b);
cprintf("\n\r 1 Input Customer Data ");
textcolor(c2); textbackground(c2b);
cprintf("\n\r 2 Return Movie ");
textcolor(c3); textbackground(c3b);
cprintf("\n\r 3 Business Of Movie ");
textcolor(c4); textbackground(c4b);
cprintf("\n\r 4 View Data Base ");
textcolor(c5); textbackground(c5b);
cprintf("\n\r 5 Search By Customer No");
textcolor(c6); textbackground(c6b);
cprintf("\n\r 6 Exit The Program ");
cout <<"\n\n OPTION SELECTED : " <0)
{
ofstream out;
out.open("fold.txt",ios::app|ios::binary);
ifstream in; //for customer with same name
in.open("fold.txt",ios::binary);
in.seekg(0,ios::end);
int s=(int)in.tellg()/ sizeof(sport);
if(s>0)
{
struct sign
{int a;
char b[30];
}pk[30];
int m=0;
for(int k=0;k>in;
if(in<1||in>30)
{
cout<<"Invalid ID No"<
C_Projects Source Codes List | Source Code Home
|
|
|