ممكن مساعده في تيتوريال 3
Write a C++ program for a video shop to handle some of the basic operation in the shop. Create a
[FONT=Times New Roman,Times New Roman][FONT=Times New Roman,Times New Roman]struct [/FONT][/FONT][FONT=Times New Roman,Times New Roman][FONT=Times New Roman,Times New Roman][/FONT][/FONT][FONT=Courier New,Courier New][FONT=Courier New,Courier New]movieItem [/FONT][/FONT]to record the movie title, the number of available copies of this movie and the genre of the movie.
In your program, it is also important to keep information about customers. Therefore, create a struct
[FONT=Courier New,Courier New][FONT=Courier New,Courier New]customer [/FONT][/FONT]to hold customer’s name, and the list of movies rented by this customer (array of type [FONT=Courier New,Courier New][FONT=Courier New,Courier New]movieItem)[/FONT][/FONT].
Your program must contain at least the following functions:
- A function that takes as parameter
[FONT=Courier New,Courier New][FONT=Courier New,Courier New]myMovie [/FONT][/FONT]of type [FONT=Courier New,Courier New][FONT=Courier New,Courier New]movieItem[/FONT][/FONT]. The function should prompt the user to enter the movie details.
- A function that takes as parameter
[FONT=Courier New,Courier New][FONT=Courier New,Courier New]myMovie [/FONT][/FONT]of type [FONT=Courier New,Courier New][FONT=Courier New,Courier New]movieItem[/FONT][/FONT]. The function should prints the movie details.
- A function named
[FONT=Times New Roman,Times New Roman][FONT=Times New Roman,Times New Roman]outOfStock [/FONT][/FONT][FONT=Times New Roman,Times New Roman][FONT=Times New Roman,Times New Roman][/FONT][/FONT]that takes as parameters an array of movies, and the number of movies in the array. The function should search the List array and print out the titles of all the movies in the List which are out of stock (number of copies equals zero).
- A function that takes as parameter
[FONT=Courier New,Courier New][FONT=Courier New,Courier New]myCustomer [/FONT][/FONT]of type [FONT=Courier New,Courier New][FONT=Courier New,Courier New]customer. [/FONT][/FONT]The function should print the titles of all movies rented by [FONT=Courier New,Courier New][FONT=Courier New,Courier New]myCustomer. [/FONT][/FONT]
[FONT=Courier New,Courier New][FONT=Courier New,Courier New][/FONT][/FONT]Test your program with samples of movies and customer details. Suppose the video shop has 20 movies, and 10 customers. Use an array of 20 components of type
[FONT=Courier New,Courier New][FONT=Courier New,Courier New]movieItem[/FONT][/FONT], and an array of 10 components of type [FONT=Courier New,Courier New][FONT=Courier New,Courier New]customer. [/FONT][/FONT]
[FONT=Courier New,Courier New][FONT=Courier New,Courier New][/FONT][/FONT]