Article Share Weblog

Read Share Support

Lab 02: Struct and Functions

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
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)

Add a function inputDVDDetails that would allow the user to enter the data about a single DVD.

  • void inputDVDDetails( DVD )

Add a function printDVDDetails that would print the DVD data on the console in list view.

  • void printDVDDetails (DVD )

Create a separate C++ program for this exercise.

Exercise 02
Create an array of DVD structure capable of holding data of not less than ten DVDs.
Add a function inputDVDDetails that would allow the user to enter the DVD data, one record at a time.

  • void inputDVDDetails( DVD )

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 )

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 )

Create a main menu with the following menu items:

  • Add New
  • List View
  • Grid View
  • Exit

Create a separate C++ program for this exercise.
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.