/* list01.cpp                                                          */
/* First created 24 Oct 1996                                           */
/* Updated Friday 11th November 2003, 11:12 PT                         */
/* Author:  A.H.Dawson                                                 */

/* This program is the first version in a series of programs           */
/* resulting in the final list.cpp program, which is the solution to   */
/* an Inventory Tracking project of the "Pointers and Linked Lists" chapter*/
/*                                                                     */
/* This version (list01.cpp) displays the Main Menu, allows the user   */
/* to enter an integer choice, which triggers the call to a function.  */
/*                                                                     */
/* The functions called from the Main Menu are empty stubs, which when */
/* executed, simply display the function's name.  Version list02.cpp   */
/* is a direct copy of this code, with the the code for the menu 1     */
/* option completed. Subsequent versions will have subsequent menu     */
/* options working. The final version of the program will be called    */
/* list.cpp, and will be the fully functional version.                 */

/* Status: COMPLETE                                                    */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>  // for string functions
#include <conio.h >  /* for getch() */
#include <iostream.h> // for cin and cout


int get_choice(void);
int insert_new_product_type(int upc);
int add_new_node(int upc);
int display_all_inventory(void);
int display_individual_inventory(int upc);
int print_individual(void);
int change_price(int upc);
int transfer_in(int upc);
int transfer_out(int upc);

struct node
{
	int upc;
	char description[20];
	float price;
	int quantity;
	node *link;
};

 node *start_pointer = NULL;
 node *current_pointer = NULL;


/**********************************************************************/

main()
{
	int upc, choice;

	choice = get_choice();

	while (choice != 9)
	{
		switch(choice)
		{
			case 1:
				cout << "\nPlease enter the UPC code:  ";
				cin >> upc;
				insert_new_product_type(upc);
				break;
			case 2:
				display_all_inventory();
				break;
			case 3:
				cout << "\nPlease enter the UPC code:  ";
				cin >> upc;
				display_individual_inventory(upc);
				break;
			case 4:
				cout << "\nPlease enter the UPC code:  ";
				cin >> upc;
				change_price(upc);
				break;
			case 5:
				cout << "\nPlease enter the UPC code:  ";
				cin >> upc;
				transfer_in(upc);
				break;
			case 6:
				cout << "\nPlease enter the UPC code:  ";
				cin >> upc;
				transfer_out(upc);
				break;
			case 9:
				exit(0);
			default:
				cout << "\nChoice not in list\n  ";
				cout << "\nPlease try again....\n  ";
		} /* end switch */

		choice = get_choice();

	} /* end while */

	return 0;

}   /* end main */


/**********************************************************************/


int get_choice(void)
{
	int choice;

	cout << "\n\nMain Menu\n\n";
	cout << "1)  Insert new product type\n";
	cout << "2)  Display all inventory\n";
	cout << "3)  Display individual inventory\n";
	cout << "4)  Change price\n";
	cout << "5)  Transfer in\n";
	cout << "6)  Transfer out\n";
	cout << "9)  Quit\n";
	cout << "  \nPlease enter your choice: \n";

	choice = 0;

	cin >> choice;

	return choice;

}   /* end of get_choice */


/**********************************************************************/

int insert_new_product_type(int upc)
{

	cout << "\n\nNow in the insert_new_product_type function\n";
	cout << "UPC = " << upc << endl;
	cout << "Press any key to continue\n\n";
	getch();
	return 0;
}

/**********************************************************************/

int display_all_inventory(void)
{
	cout << "\n\nNow in display_all_inventory\n";
	cout << "Press any key to continue\n";
	getch();
	return 0;
}

/**********************************************************************/

int display_individual_inventory(int upc)
{
	cout << "\n\nNow in display_individual_inventory function\n";
	cout << "UPC = " << upc << endl;
	cout << "\nPress any key to continue\n";
	getch();
	return 0;
}

/**********************************************************************/

int change_price(int upc)
{
	cout << "\n\nNow in change_price function\n";
	cout << "UPC = " << upc << endl;
	cout << "\nPress any key to continue\n";
	getch();
	return 0;
}

/**********************************************************************/

int transfer_in(int upc)
{
	cout << "\n\nNow in transfer_in function\n";
	cout << "UPC = " << upc << endl;
	cout << "\nPress any key to continue\n";
	getch();
	return 0;
}

/**********************************************************************/

int transfer_out(int upc)
{
	cout << "\n\nNow in transfer_out function\n";
	cout << "UPC = " <<  upc << endl;
	cout << "\nPress any key to continue\n";
	getch();
	return 0;
}

/**********************************************************************/

