Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,547 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,563 people online right now. Registration is fast and FREE... Join Now!




Video Rental Application

 
Reply to this topicStart new topic

Video Rental Application, MULTICHOIE VIDEO RENTAL SHOP

leka
30 Oct, 2007 - 10:27 AM
Post #1

New D.I.C Head
*

Joined: 26 Oct, 2007
Posts: 2


My Contributions
PLEASE HELP ME ON THIS PROGRAM GUYS AND MY U PLEASE SEND IT TO MY E-MAIL ADDRESS TOMORROW B 4 12 GUYS PLEASE!!

HERE IS THE PROBLEM
MULTICHOICE VIDEO RENTAL SHOP needs an Object Oriented program that process the following information about ten (10) videos in their stock

The title, the director, the year produced and a list of main actors for each video. (If there are more than five main actors, include only the five most famous actors)
The function setVideo that input information into each video object
The function getVideo that displays information of a particular video on the screen
A customer (identified by ID) plus his full names and address can borrow at most 2 videos @ R12.50 per day. A penalty of 10% per day is charged if returned late. The borrow period is at most 7 days
Video titles should not exceed 25 characters in length. If that happens, truncate the length to a most 25 characters
A video should be checked if is not rented out before borrow transaction is processed. If borrowed out the customer should either be requested for the second choice or be advised when the video is expected back in the shop
Failure for the shop to receive the video back within 7 days, is considered permanent loss and the customer is liable to a R400.00 compensation fee
Information about the number of films in stock at any point in time should be readily available
At the end of business, a report should be generated showing
Which films are rented out and when are they due
To which customers they are borrowed to
Which videos are left in stock
How much money was collected for the day

AND HERE IS MY SOURCE CODE

CODE
#ifndef "VIDEO_H"
#define "VIDEO_H"
#include<iostream>
#include<string>
using namespace std;

class video
{     public:
   const static int actor=2;
   const static int size=1;
    video();
    void setVideo();
    void getVideo();
    void count(int);
    void date(int,int,int);
    void disDate();

private:
    string title;
    string director;
    int yearProduced;
    int number;
    string mainActors[actor];
    int day;
    int month;
    int year;

};
#endif


video::video()
{      
    yearProduced=day=month=year=0;
    
}


void video::setVideo()
{
for(int a=0;a<1;a++)
    
    cout<<" VIDEO NO:"<<a+1<<endl<<endl;

    cout<<"ENTER VIDEO TITLE: ";
    getline(cin,title,'\n');
    cin.get();

    cout<<"\nENTER DIRECTORS NAME: ";
    getline(cin,director,'\n');
    cin.get();

    cout<<"\nENTER THE YEAR VIDEO WAS PRODUCED: ";
    cin>>yearProduced;
    cin.get();

    cout<<"\nENTER MAIN ACTORS IN THE VIDEO"<<endl;
    const int Actor=2;
    for(int a=0;a<Actor;a++)
    {    
        getline(cin,mainActors[a],'\n');
    }
    cin.get();

}



void video::count(int videoNum)
{    
    if(videoNum==1)
    {  
        getVideo();
    }
    else
        cout<<"\n\t-------------------------"<<endl;
        cout<<"\n\tVIDEO HAS BEEN RENTED OUT"<<endl;
        cout<<"\n\t-------------------------"<<endl;
}


      

void video::getVideo()
{      
    cout<<"VIDEO TITLE: "<<title<<"\n\nDIRECTORS NAME: "<<director
        <<"\n\nYEAR PRODUCED: "<<yearProduced<<endl;

   cout<<"\n\nMAIN ACTORS IN THE VIDEO"<<endl;

    for(int j=0;j<actor;j++)
    {    
           cout<<mainActors[j]<<"\n";
    }
    cout<<endl<<endl;
}


void video::date(int d, int m, int y)
{    
    day=d;
    month=m;
    year=y;
}



void video::disDate()
{  
    cout<<day<<'/'<<month<<'/'<<year<<endl;
}



int main()
{      
    video video1;

    cout<<"CAPTURE INFORMATION ABOUT EACH VIDEO "
            <<"IN STORE TODAY"<<endl<<endl;


     video1.setVideo();
     cout<<"__________"<<endl;
     cout<<"VIDEO NO:1"<<endl;
      cout<<"__________"<<endl<<endl;
     video1.getVideo();
    

    cout<<"\nDO U WANT TO BORROW A VIDEO(Y/N)?: ";

    char answer;

    cin>>answer;

    if(answer=='y' || answer=='Y')
    {
        

        cout<<"\nENTER UR ID NO: ";
        string Id;
        cin>>Id;
        cin.get();
        cout<<"\n\nUR NAMES IN FULL: ";

        string names;

        getline(cin,names,'\n');

        cout<<"\n\nENTER UR ADDRESS"<<endl;

        string addres;

        getline(cin,addres,'\n');

        cout<<"\nENTER THE NUMBER OF THE VIDEO U WANT TO BORROW: ";
        
        int videoNum;

        cin>>videoNum;

        video1.count(videoNum);

        cout<<endl;

        cout<<endl<<endl;

        cout<<"\n\t--------------------------------"<<endl;
        cout<<"\n\tTHE VIDEOS BEING RENTED OUT "<<endl;
        cout<<"\n\t--------------------------------"<<endl;
        video1.getVideo();

        cout<<"HAS BEEN BORROWED BY: "<<names<<"\n\nID NUMBER: "
            <<Id<<"\n\nADDRESS NO: "<<addres<<"\n\nRETURN DATE: ";
            video1.disDate();

    
        
        
    }
    else
        cout<<"\nPLS DO VISIT US NEXT TIME"<<endl<<endl;
    
    



    return 0;
}
                        


This post has been edited by jjhaag: 30 Oct, 2007 - 11:44 AM
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Video Rental Application
30 Oct, 2007 - 10:39 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,349



Thanked: 51 times
Dream Kudos: 25
My Contributions
Good afternoon,

Our members would be pleased to provide some guidance, but will probably not send it to your email address. We prefer to provide help in the forums, where everyone can benefit. Of course, if you simply want the program completed for you, you may wish to post this in the 'Job Offers' section with the offered renumeration.

As for the code itself, can you elaborate as to the problem you are encountering? Are you receiving error messages? If so, can you please post them? Are you getting undesired behaviour? If so, can you describe the expected behaviour as well as the actual behaviour?
User is offlineProfile CardPM
+Quote Post

MikeRaines
RE: Video Rental Application
30 Oct, 2007 - 11:41 AM
Post #3

D.I.C Head
**

Joined: 30 Oct, 2007
Posts: 76



Thanked: 1 times
My Contributions
Since im not exactlly sure what problems you are encountering, the only help I can offer is an overview of how I would implement this.

Classes:
Video
Transactions
Customers

video: Would be implemented as a linked list or managed array of class Video this would make tracking what is currentlly available easy. Every video entry would contain an array of strings for the actors.
All the standard gets and sets, along with a setCheckedOut(), setDueDate(), getTotalAvailable() and the corresponding gets for CheckedOut and DueDate. Each video would also contain the ID of it's current renter.

Transactions: Would be implemented as a linked list, and only modified when a rental is made. Methods would stores video rented and customer along with other relevent information.

Customer:Again, as a linked list. this would contain all standard gets and sets for customer ID, name, and current video's rented. I would also implement a getByID(int) method for easy referencing.

This way the number of video's available at all times, and all transactions are recorded during the process, due date of any video is avilable, along with it's bool availability.

At the end of business, the transactions class can easily be traversed getting all your financial information.
Traversing the Video class would return all rented video's along with the ID's of their renters.
Passing those ID's would return the renter's info.

Hopefully this overview helps, and I hope I covered all the areas of the assignment.

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 09:33PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month