Article Share Weblog

Read Share Support

Lab 03: Struct and Searching

Posted by Fawad Ishaq on June 25, 2008

| Ask an Expert | Live Programming Help |

Instructions

  • You must have installed Microsoft Visual Studio 6.0/Microsoft Visual Studio .NET 2003/Microsoft Visual Studio .NET 2005 on your machine to try the programs.
  • To develop the C++ program on Microsoft Visual Studio 6.0 please read the handout “How to create your first C++ program using Visual C++ 6.0”.
  • To develop the C++ program on Microsoft Visual Studio .NET 2003 please read the handout How to create your first C++ program using Visual C++ .NET 2003.
  • To develop the C++ program on Microsoft Visual Studio .NET 2005 please read the handout How to create your first C++ program using Visual C++ .NET 2005.

Exercise 01
(A) Define a structure DVD having following data members:
• DVD code (use variable of type integer to store the code of the DVD)
• Movie name (use char array of 50 elements to store the movie name)
• Actor name (use char array of 50 elements to store the actor name)
• Actress name (use char array of 50 elements to store the actress name)
• Release Date (use char array of 50 elements to store the movie release date)
• Price (use variable of type double to store the price of the DVD)
(B) Create an array of DVD structure capable of holding data of not less than ten DVDs.
(C) Add a function inputDVDDetails that would allow the user to enter the DVD data, one record at a time.
void inputDVDDetails( DVD )
(D) Add a function printDVDDetails_ListView that would print the data of all the DVDs on the console in list view.
void printDVDDetails_ListView (DVD[], int )
(E) Add a function printDVDDetails_GridView that would print the data of all the DVDs on the console in grid view.
void printDVDDetails_GridView (DVD[], int )
(F) Add a feature that would allow the user to search a DVD by code. (do it without function)
(G) Add a feature that would allow the user to search a DVD by movie name. (do it without function)
(H) Add a feature that would allow the user to search a DVD by actor name. (do it without function)
(I) Add a feature that would allow the user to search a DVD by actress name. (do it without function)
(J) Add a feature that would allow the user to search a DVD by release data. (do it without function)
(K) Add a feature that would allow the user to search a DVD by price. (do it without function)
(L) Create a main menu with the following menu items:
• Add New
• List View
• Grid View
• Search by DVD Code
• Search by Movie Name
• Search by Actor Name
• Search by Actress Name
• Search by Release Date
• Search by Price
• Exit
(M) Create a separate C++ program for this exercise.
(N) The program should not allow the user to enter more than ten records.

Exercise 02
(A) Define a structure DVD having following data members:
• DVD code (use variable of type integer to store the code of the DVD)
• Movie name (use char array of 50 elements to store the movie name)
• Actor name (use char array of 50 elements to store the actor name)
• Actress name (use char array of 50 elements to store the actress name)
• Release Date (use char array of 50 elements to store the movie release date)
• Price (use variable of type double to store the price of the DVD)
(B) Create an array of DVD structure capable of holding data of not less than ten DVDs.
(C) Add a function inputDVDDetails that would allow the user to enter the DVD data, one record at a time.
void inputDVDDetails( DVD )
(D) Add a function printDVDDetails_ListView that would print the data of all the DVDs on the console in list view.
void printDVDDetails_ListView (DVD[], int )
(E) Add a function printDVDDetails_GridView that would print the data of all the DVDs on the console in grid view.
void printDVDDetails_GridView (DVD[], int )
(F) Add a function searchByCode that would allow the user to search a DVD by code.
boolean searchByCode ( DVD[], int, int )
(G) Add a function searchByMovieName that would allow the user to search a DVD by movie name.
boolean searchByMovieName( DVD[], int, char[] )
(H) Add a function searchByActorName that would allow the user to search a DVD by actor name. The program must show all the movies in which the actor appeared.
boolean searchByActorName ( DVD[], int, char[] )
(I) Add a function searchByActressName that would allow the user to search a DVD by actress name. The program must show all the movies in which the actress appeared.
boolean searchByActressName ( DVD[], int, char[] )
(J) Add a function searchByReleaseDate that would allow the user to search a DVD by release data. The program must show all the movies released on a particular date.
boolean searchByReleaseDate ( DVD[], int, char[] )
(K) Add a function searchByPrice that would allow the user to search a DVD by price. The program must how all the movies having the same price.
boolean searchByPrice ( DVD[], int, double )
(L) Create a main menu with the following menu items:
• Add New
• List View
• Grid View
• Search by DVD Code
• Search by Movie Name
• Search by Actor Name
• Search by Actress Name
• Search by Release Date
• Search by Price
• Exit
(M) Create a separate C++ program for this exercise.
(N) The program should not allow the user to enter more than ten records.

How to submit

  • Submit your assignments to Mr. Adeel as per the schedule announced by him.
  • No assignment shall be evaluated/accepted after the due date.
  • Copy assignments will be cancelled.
  • There will be an individual viva of this assignment. Your evaluation is strictly based on your performance in the viva.
  • Non-professional behavior during the viva may lead to assignment cancellation.

Ask an Expert - Visit my Virtual Office at LivePerson


| Download PDF Here |

Leave a Reply

You must be logged in to post a comment.