Professional Documents
Culture Documents
Ilist and Arraylist Program: Using Using Using Using Namespace Class Static Void String New New New New
Ilist and Arraylist Program: Using Using Using Using Namespace Class Static Void String New New New New
namespace BookStoreDemo { class Program { static void Main(string[] args) { BookStore b = new BookStore(); Book b1 = new Book("C#", 5, 200); Book b2 = new Book("J#", 54, 2500); Book b3 = new Book("F#", 52, 2060); b.AddBook(b1); b.AddBook(b2); b.AddBook(b3); string c; do { Console.WriteLine("select 1 to add book: 2 to display and 3 to search and 4 to exit");
} } while (c != "4"); } } }
namespace BookStoreDemo { class Book { String BookName; int Qty; double Cost; public Book(String BookName, int Qty, double Cost) { this.BookName = BookName; this.Qty = Qty; this.Cost = Cost; } public void SetName(String name) { BookName = name; } public void SetQty(int qty) {