static void Main( )
        {
            // declare new linked lists
            LL LLofDrugs = new LL( );
            LL emptyList = new LL( );

            // read file, test your Append method
            using (FileStream file = File.Open("RXQT1503.txt", FileMode.Open, FileAccess.Read))
                using (StreamReader reader = new StreamReader(file))
                {
                    for (int i = 0; i < 10; i++)
                    {
                        LLofDrugs.AddInOrder(Drug.ParseFileLine(reader.ReadLine( )));
                    }
                }

            //PrintFormat MyMethod = DetailedString;

            LLofDrugs.PrintList(DetailedString);
            WriteLine();
            LLofDrugs.PrintList(ShortString);
        }
예제 #2
0
        static void Main( )
        {
            // declare new linked lists
            LL LLofDrugs = new LL( );
            LL emptyList = new LL( );

            // read file, test your Append method
            using (FileStream file = File.Open("RXQT1503.txt", FileMode.Open, FileAccess.Read))
                using (StreamReader reader = new StreamReader(file))
                {
                    for (int i = 0; i < 10; i++)
                    {
                        LLofDrugs.Append(Drug.ParseFileLine(reader.ReadLine( )));
                    }
                }

            LLofDrugs.PrintList();

            // Test your Pop method
            // This 'pops' all nodes in the list one-by-one
            //~ while( LLofDrugs.Pop( ) != null )
            //~ {
            //~ WriteLine();
            //~ LLofDrugs.PrintList();
            //~ }

            // Test the different cases for Remove
            // These should all execute without error when only 10 lines of the file are imported
            //~ LLofDrugs.Remove("AXIRON");
            //~ LLofDrugs.Remove("TRULICITY");
            //~ LLofDrugs.Remove("CYMBALTA");
            //~ LLofDrugs.Remove("IMAGINATION");
            //~ emptyList.Remove("AXIRON");
            //~ WriteLine();
            //~ LLofDrugs.PrintList();
        }