1 //File: cla15.cpp 2 //Programmer: 3 //Class: CSCI 2170 4 // 5 //This program reads and prints...
Question:
=====================================================================
1 James W. Wilson 2 1113 3 A Bridge Too Far 4 11/19/95 5 Wanda T. Bear 6 1114 7 A Bridge Too Far 8 11/19/95 9 Linda W. Smith 10 1115 11 The Man in White 12 11/20/95 13 Carol M. Brown 14 1117 15 All the Robots 16 11/20/95 17 Franklin D. Russell 18 1118 19 The Man in White 20 11/21/95=====================================================================
1 A Bridge Too Far 2 10 3 mystery 4 The Cat and Mouse 5 5 6 comedy 7 Today is Night 8 20 9 adventure 10 The Movie Factor 11 19 12 musical 13 All the Robots 14 20 15 horror 16 The Sand 17 5 18 adventure 19 My Name is Sue 20 14 21 comedy 22 Why Me? 23 2 24 mystery 25 The Man in White 26 17 27 musical===================================================
name of customer (string)
id number of customer (integer)
name of video rented by the customer (a string)
return date of the video ( a string)
Exercise 3: Using the above struct declaration as a guide, show code to set up a struct called customerType that will have fields for a customer's name, the customer's id number (integer), the title of the movie/video rented, and when the video is to be returned. Also declare a variable customer of the type customerType. Insert this code into the two positions indicated by comments in the cla15.cpp program.
====================================================
Exercise 4: Add code to read values for the variable customer described in exercise 3. This is accomplished by a call to the function getCustomer(). Complete the function getCustomer() so that it will read values for one customer from the indicated input file stream. Include this code in the indicated position of the cla15.cpp program.
==============================================
Exercise 5 Add code to the cla15.cpp program to define a variable called allCustomers that will store information contained in the cla15b.dat file for as many as 20 customers as described in Exercise 4.
==============================================================
Exercise 6: Write code to print out the id number of the second customer included in the allCustomers array as described in exercise 5. Place your answer on the answer sheet.
==============================================
Exercise 7: Add code to the stub function called printRentalInfo (at the indicated position inside cla15.cpp) so that it will receive the allCustomers array defined in Exercise 5, a movie title, and the number of customers, and will print out a list of all the names of customers who have rented the video indicated in the movie title sent to the function.
====================================================
Exercise 8: Now complete the Movie Rent Video Store program. Add code to the stub function called printCustomer (at the indicated position inside cla15.cpp) that will receive one struct of type customerType and will print out all information related to this customer (name, id, name of video rented, and return date of video).