c++ Project on Video Library Management

Embed Size (px)

Citation preview

//Video Library Management System // Declaration of header files #include #include #include #include #include #include #include #include #include #include #include typedef char option[15]; const int ROW = 10, COL = 10; int scan; int ascii; // To hold the special characters for moving the prompt in menu

// To display the main menu options option a[]= { "NewCassPur", "ListOfPurchase", "DailyCassSales", "SalesReport", "AddOtherExp", "OtherExpRep", "ClosingStock", "MonthlyProfit", "Exit" }; // Function used to do screening class main_menu { int i,done; public: void void void char void void }; /* Class member functions for drawing boxes */ class shape { public: void line_hor(int, int, int, char); void line_ver(int, int, int, char); void box(int, int, int, int, char); }; // Class contains the cassettes/CDs deposit of customers class cassettes normalvideo(int x,int y,char *str); reversevideo(int x,int y,char *str); box(int x1,int y1,int x2,int y2); menu(); control_menu(); help(void);

{ public: void new_cassettes(void); // Function to add new cassettes /CDs in music shop // For cassettes/CDs entry into the cassettes.dat data file void add_to_file(int, char t_Cass_name[30], char t_Comp_name[30] , int, int, int, int, float); void display_list(void); // Displaying the cassettes/CDs list void delete_cassette(int); // Deletes the temporary cassette rec ord int last_cas_code(void); // if the file is exist or not char *return_name(int); // Function for validation entry of name char *return_address(int); // Function for validation entry of a ddress int recordno(int); void display(int); // To display the cassette/CD information acc ount private: // Data Members of cassette.dat data file int cas_code; // cassette/CD code - film, nonfilm, religious char Cass_name[30]; // Title of the cassette/CD char Comp_name[30]; // cassette/CD company int tot_cassette; // Total cassette/CD purchased int dd, mm, yy; // Date of purchase float price; // Price per cassette/CD }; class balance { public: void add_to_file(int, int, int, int, int, float); // Add r ecord for balance cassette/CD void balance_cassette(void); // Function to display the balan ce cassette/CD void delete_balance(int); // Deleting the balance from Tba l.dat int give_balance(int); // returns the current balance of a part icular // cassette/CD c ode void Update_balance(int, int, int , int , int, float); // Functi on to update balance after cassette/CD sale float return_price(int); // Return the cassette/CD price void monthly_profit(void); ansaction private: // Data members of int cas_code; // int cas_bal; // int dd; // Balance int mm; int yy; float price; // }; Tbal.dat data file cassette/CD code to be balance Total number of cassettes/CDs in balance date Unit price of cassettes/CDs on code wise // Monthly profit after every tr

// Class contains the customers daily cassette/CD transaction entry class account { public: void new_account(void); // Function to sale cassettes/CDs void close_account(void); // Function to close the cassett e/CD purchase void clear(int, int); // Function to perform a clear screen func tion void Display_sales(void); // Displaying the sales report o f cassettes/CDs int last_cas_code(void); // if the file is exist or not float sales_status(int m1, int y1, float cod1, float cod2, float cod3); private: void add_to_file(int, char tP_name[30], char tP_address[30],int, int, int, int); // Function to add transaction records void delete_account(int); // Function to delete a transaction re cord // Data members of person.dat data file int cas_code; // cassette/CD code - film, nonfilm, rel igious char P_name[30]; // Person Name char P_address[30]; // Person Address int No_cass; // Number of cassette/CD int dd, mm, yy; // To store the system date/ purchase da te }; class other { public : // Function to display other expense screen like salary, // electricity bill, telephone and miscellaneous expences void Expense_other(void); // Add the data to Other.dat data file void add_to_file(int, char tNat_Expen[30], int, int, int, float) ; void display_expense(void); // Display the expenses float other_status(int m1, int y1); private : // Data members of other.dat data file int O_code; // Other expence code /* The other expence code as : 1 Salary to workers, 2 Electricity bill 3 Telephone bills 4 Miscellaneous expenses */ char Nat_Expen[30]; // Nature of expense description int dd, mm, yy; // Expense date float amount; // Expense amount }; // Function to displays all the menu prompt messages // from the pointer array of option a[]

void main_menu::normalvideo(int x,int y,char *str) { gotoxy(x,y); cprintf("%s",str); } // Function to move the cursor on the menu prompt // with a reverse video color void main_menu::reversevideo(int x,int y,char *str) { textcolor(5+143); textbackground(WHITE); gotoxy(x,y); cprintf("%s",str); textcolor(GREEN); textbackground(BLACK); } void main_menu::box(int x1,int y1,int x2,int y2) { for(int col=x1;col