I finished the lab, and everything works, but I just don't like the way it looks...a bit disjointed to my eye. I'm happy that it works, but I want to write robust, readable code as well as functional. So, if you're interested (have spare time) would you take a look at the file and leave constructive feedback for improvement please?
MainDriver
#include <iostream>
#include <iomanip>
#include <string>
// User-defined headers
#include "MediaCollection.h"
// Global function definitions
void DisplayMenu();
using namespace std;
void main()
{
// Create my media collection
MediaCollection MediaCollection;
// Declare and initialize the variable used for the menu
int menuChoice = 0;
do
{
cout << endl << "Welcome to the " << MediaCollection.getCollectionName()
<< " Media Collection Menu. Select from the following choices:" << endl << endl;
// Display the menu of choices
DisplayMenu();
menuChoice = MediaCollection.MenuSelection();
switch (menuChoice)
{
case 1:
MediaCollection.addMedia();
break;
case 12:
cout << "Terminating program... Have a great day!" << endl;
break;
default:
cout << "Invalid choice. Please select again.";
}
}
while(menuChoice != 12);
// Wait for user input before terminating program
system("PAUSE");
}