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()
            "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()
         m_lst_strAddressBook.ForEach(s => Console.WriteLine(s));

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

         char chrChoice = ' ';

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

            switch (chrChoice)
               case '1':

               case '2':
               case '3':

               case '4':

               case '5':

               case '6':


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, learning, and sharing knowledge.