Using C++, please complete the following..... Video Store (100 Points) Create a
ID: 3796646 • Letter: U
Question
Using C++, please complete the following..... Video Store (100 Points)
Create a Video Store
• We need to write a program for a Video Store. The Video Store will do the following tasks:
Rent a video; that is, check out a video.
Return, or check in, a video.
Create a list of videos owned by the store.
Show the details of a particular video.
Print a list of all the videos in the store.
Check whether a particular video is in the store.
Maintain a customer database.
Print a list of all the videos rented by each customer.
• The video store has two major components: videos and customers. The class videoType will be used to implement a video. The common things associated with a video are as follows:
Title of the movie
Names of the stars
Name of the producer
Name of the director
Name of the production company
Number of copies in the store
• The basic operations on an object of type videoType are as follows:
Set the video information that is, the title, stars, production company, and so on.
Show the details of a particular video.
Check the number of copies in the store.
Check out (that is, rent) the video. In other words, if the number of copies is greater than zero, decrement the number of copies by one.
Check in (that is, return) the video. To check in a video, first we must check whether the store owns such a video and, if it does, increment the number of copies by one.
Check whether a particular video is available—that is, check whether the number of copies currently in the store is greater than zero.
• The class customerType will be used to implement a customer. The customer object stores information about a customer, such as the first name, last name, account number, and a list of videos rented by the customer.
• The basic operations on an object of type customerType are as follows:
Print the name, the account number, and the list of rented videos.
Set the name and the account number.
Rent a video; that is, add the rented video to the list.
Return a video; that is, delete the rented video from the list.
Show the account number.
• The video store will maintain various lists:
A list of all the videos in the store.
A list of all the store’s customers.
Lists of the videos currently rented by each customer
• Use a function createVideoList in the main program to read the videos data from a provided videos input file and create a linked list of videos. The function will do this using the following steps:
1 Read the video’s data and store it in a video object.
2 Insert the video in the list.
3 Repeat Steps 1 and 2 for each video’s data in the file.
• Use another function, createCustomerList, to read the customers data from a provided customers input file and create a list of customers.
• Use the function displayMenu to inform the user what to do. It contains the following output statements:
Select one of the following:
1: To check whether the store carries a particular video
2: To check out a video
3: To check in a video
4: To check whether a particular video is in stock
5: To print only the titles of all the videos
6: To print a list of all the videos
9: To exit
• Design and implement the Video Store program.
• Submit the source code of the implemented program and a report that includes:
Discussion of the used data structures o Discussion of the algorithm that you used to search the list for a particular video and the time complexity of this algorithm.
Screen shots of your testing results.
Explanation / Answer
public abstract class Videoclass implements Serializable{
public String vid_name;
public double vid_length;
public String vid_status;
public Video(String vidName, double vidLength)
{
vid_name= vidName;
vid_length=vidLength;
}
public String getVidName()
{
return vid_name;
}
public double getMovLength()
{
return vid_length;
}
public String getVidStatus() {
return vid_status;
}
public void setVidStatus(String vid_status) {
this.vid_status = vid_status;
}
public abstract boolean equals(String vid_name, String type);
}
dvd class:
public abstract class DVD extends Video implements Serializable{
private String _Director;
private double vid_price;
//Constructor
public DVD(String vidName, double vidLength )
{
super (vidName, vidLength);
}
public DVD(String vidName, double vidLength, double vidPrice, String Director )
{
super(vidName, vidLength);
_Director = Director;
vid_price=vidPrice;
this.vid_price=50.00;
}
public boolean equals(String vid_name, String type)
{
if (type.equalsIgnoreCase("DVD"))
{
if(type.equalsIgnoreCase(getVidName()))
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.