need major help on a address book in c# using strings that does the 5 stages below preferably code help required.
1 Add Entry
2 Delete Entry
3 Print Book to Screen
4 Edit a Record
5 Search for a record using either Surname, Firstname or Road Name

Recommended Answers

All 9 Replies

Have you written the menu, yet?

If you have a look in the code snippets section, you will find some code just to do that.

yes menu is done I need help with storing names using strings

You can store the names in a List<string>

how would that work using strings an example if possible

Here is a shell you can fill in.

using System;
using System.Collections.Generic;

namespace DW_398225
{
   public class CAddressBookProgram
   {
      /// <summary>
      /// Plain Text tab-delimited Address Strings go here
      /// </summary>
      private static List<string> m_lst_strAddressBook = new List<string>()
      { // Pre-loaded
         "Sam Jacobs\t913-222-5555\t123 Jones St",
         "Herman Munster\t213-666-7777\t1313 Mockingbird Lane",
         "Po Tus\t202-555-1212\t1600 Pennsylvania Avenue"
      };

      public static void ShowMenu()
      {
         Console.WriteLine(
            "1 Add Entry\n" +
            "2 Delete Entry\n" +
            "3 Print Book to Screen\n" +
            "4 Edit a Record\n" +
            "5 Search for a record using either Surname, Firstname or Road Name\n" +
            "6 Quit");
      }

      public static void Display()
      {
         Console.WriteLine();
         m_lst_strAddressBook.ForEach(s => Console.WriteLine(s));
         Console.WriteLine();
      }

      static void Main(string[] args)
      {
         Console.WriteLine("Welcome to the Address Book");

         char chrChoice = ' ';

         while (!chrChoice.Equals('6'))
         {
            ShowMenu();
            chrChoice = Console.ReadLine().Trim()[0];

            switch (chrChoice)
            {
               case '1':
                  //Add
                  break;

               case '2':
                  //Delete
                  break;
                  
               case '3':
                  Display();
                  break;

               case '4':
                  //Edit
                  break;

               case '5':
                  //Search
                  break;

               case '6':
                  //Quit
                  break;

               default:
                  break;
            }
         }
      }
   }
}

i need it to be a 2 dimensional array

What data will be contained in the left side and what data will be contained in the right side?

Please see this post

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.