SlideShare a Scribd company logo
1 of 4
BookStore.CS


using   System;
using   System.Collections.Generic;
using   System.Linq;
using   System.Text;
using   System.Collections;

namespace ConsoleApplication1
{

    public delegate void EditionHandler();
    public class Book
    {
        public string Title;        // Title of the book.
        public string Author;       // Author of the book.
        public string BookType;     //Type of Book
        public decimal Price;       // Price of the book.
        public bool Paperback;      // Is it paperback?
        public EditionHandler AddEdition;
        public Book(string title, string author, decimal price, bool
paperBack)
        {
            Title = title;
            Author = author;
            Price = price;
            Paperback = paperBack;

          }

          public void ShowEditions()
          {
              if (AddEdition != null)
                  AddEdition();
          }

    }



    public delegate void PrintBook(Book book);
    public class BookDB
    {
        // List of all books in the database:
        ArrayList list = new ArrayList();

        // Add a book to the database:
        public void AddBook(string title, string author, decimal price, bool
paperBack)
        {
            list.Add(new Book(title, author, price, paperBack));
        }

          // Call a passed-in delegate on each paperback book to process it:
          public ArrayList List
{
            get
            {
                  return list;
            }
        }

        public void PrintPaperBackBooks()
        {
            decimal TotalPrice = 0, AveragePrice = 0, ctr = 0;
            foreach (Book b in list)
            {

                  if(b.Paperback)
                  {
                  Console.WriteLine(" Book Name {0}", b.Title);
                  Console.WriteLine(" Book Author {0}", b.Author);
                  Console.WriteLine(" Book Price {0:C}", b.Price);
                  Console.WriteLine(" Book Paperback {0}", b.Paperback);
                  Console.WriteLine("n");
                  TotalPrice = TotalPrice + b.Price;
                  ctr++;
                  }

            }
            AveragePrice = TotalPrice / ctr;

            Console.WriteLine("Average of Paper Back Books is : {0:C}",
AveragePrice);
        }

        public void PrintAllBooks()
        {
            foreach (Book b in list)
            {
                Console.WriteLine(" Book   Name {0}", b.Title);
                Console.WriteLine(" Book   Author {0}", b.Author);
                Console.WriteLine(" Book   Price {0}", b.Price);
                Console.WriteLine(" Book   Paperback {0}", b.Paperback);
                Console.WriteLine("n");
            }
        }


    }

}
Program.cs
using   System;
using   System.Collections.Generic;
using   System.Linq;
using   System.Text;

namespace ConsoleApplication1
                                       {
    class Program
    {
        static void Main(string[] args)
        {
            BookDB bookDB = new BookDB();

              // Initialize the database with some books:
              AddBooks(bookDB);
              printHeader();
              bookDB.PrintPaperBackBooks();

              Book b1 = (Book)bookDB.List[0];
              b1.AddEdition = Edition1;
              b1.AddEdition += Edition2;
              b1.AddEdition += Edition3;

              b1.ShowEditions();



          }

        static void printHeader()
        {
            Console.WriteLine("Printing Book Details as on {0}",
DateTime.Now.ToString("dd-MMM-yyyy"));
            Console.WriteLine("n");


          }
          static void AddBooks(BookDB bookDB)
          {
              bookDB.AddBook("The C Programming Language",
                 "Brian W. Kernighan and Dennis M. Ritchie", 19.95m, true);
              bookDB.AddBook("The Unicode Standard 2.0",
                 "The Unicode Consortium", 39.95m, true);
              bookDB.AddBook("The MS-DOS Encyclopedia",
                 "Ray Duncan", 129.95m, false);
              bookDB.AddBook("Dogbert's Clues for the Clueless",
                 "Scott Adams", 12.00m, true);
          }

          static void Edition1()
          {
              Console.WriteLine("Edition1 added");
          }
static void Edition2()
        {
            Console.WriteLine("Edition2 added");
        }
        static void Edition3()
        {
            Console.WriteLine("Edition3 added");
        }

    }
}

More Related Content

What's hot

Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBMongoDB
 
Paris Kafka Meetup - How to develop with Kafka
Paris Kafka Meetup - How to develop with KafkaParis Kafka Meetup - How to develop with Kafka
Paris Kafka Meetup - How to develop with KafkaFlorian Hussonnois
 
Cassandra Day NY 2014: Apache Cassandra & Python for the The New York Times ⨍...
Cassandra Day NY 2014: Apache Cassandra & Python for the The New York Times ⨍...Cassandra Day NY 2014: Apache Cassandra & Python for the The New York Times ⨍...
Cassandra Day NY 2014: Apache Cassandra & Python for the The New York Times ⨍...DataStax Academy
 
Mongo sharding
Mongo shardingMongo sharding
Mongo shardingNik Kul
 
杨卫华:微博cache设计浅谈
杨卫华:微博cache设计浅谈杨卫华:微博cache设计浅谈
杨卫华:微博cache设计浅谈Leechael
 
What's new in Ansible 2.0
What's new in Ansible 2.0What's new in Ansible 2.0
What's new in Ansible 2.0Allan Denot
 
Drinking from the firehose: Logging at scale with ELK
Drinking from the firehose: Logging at scale with ELKDrinking from the firehose: Logging at scale with ELK
Drinking from the firehose: Logging at scale with ELKCteodorski
 
Shell Tips & Tricks
Shell Tips & TricksShell Tips & Tricks
Shell Tips & TricksMongoDB
 
Statim, time series interface for Perl.
Statim, time series interface for Perl.Statim, time series interface for Perl.
Statim, time series interface for Perl.Thiago Rondon
 
"Работа с утечками в V8", Роман Кривцов, MoscowJS 19
"Работа с утечками в V8", Роман Кривцов, MoscowJS 19"Работа с утечками в V8", Роман Кривцов, MoscowJS 19
"Работа с утечками в V8", Роман Кривцов, MoscowJS 19MoscowJS
 
Kubernetes Nedir?
Kubernetes Nedir?Kubernetes Nedir?
Kubernetes Nedir?AnkaraCloud
 
A quick preview of WP CLI - Chennai WordPress Meetup
A quick preview of WP CLI - Chennai WordPress MeetupA quick preview of WP CLI - Chennai WordPress Meetup
A quick preview of WP CLI - Chennai WordPress MeetupSudar Muthu
 
JEP 286 Local-Variable Type Inference - Ted's Tool Time
JEP 286 Local-Variable Type Inference - Ted's Tool TimeJEP 286 Local-Variable Type Inference - Ted's Tool Time
JEP 286 Local-Variable Type Inference - Ted's Tool TimeTed Vinke
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBAlex Bilbie
 
The Directions Pipeline at Mapbox - AWS Meetup Berlin June 2015
The Directions Pipeline at Mapbox - AWS Meetup Berlin June 2015The Directions Pipeline at Mapbox - AWS Meetup Berlin June 2015
The Directions Pipeline at Mapbox - AWS Meetup Berlin June 2015Johan
 

What's hot (18)

Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
Paris Kafka Meetup - How to develop with Kafka
Paris Kafka Meetup - How to develop with KafkaParis Kafka Meetup - How to develop with Kafka
Paris Kafka Meetup - How to develop with Kafka
 
Cassandra Day NY 2014: Apache Cassandra & Python for the The New York Times ⨍...
Cassandra Day NY 2014: Apache Cassandra & Python for the The New York Times ⨍...Cassandra Day NY 2014: Apache Cassandra & Python for the The New York Times ⨍...
Cassandra Day NY 2014: Apache Cassandra & Python for the The New York Times ⨍...
 
Mongo sharding
Mongo shardingMongo sharding
Mongo sharding
 
杨卫华:微博cache设计浅谈
杨卫华:微博cache设计浅谈杨卫华:微博cache设计浅谈
杨卫华:微博cache设计浅谈
 
What's new in Ansible 2.0
What's new in Ansible 2.0What's new in Ansible 2.0
What's new in Ansible 2.0
 
Comets notes
Comets notesComets notes
Comets notes
 
Node36
Node36Node36
Node36
 
Drinking from the firehose: Logging at scale with ELK
Drinking from the firehose: Logging at scale with ELKDrinking from the firehose: Logging at scale with ELK
Drinking from the firehose: Logging at scale with ELK
 
Shell Tips & Tricks
Shell Tips & TricksShell Tips & Tricks
Shell Tips & Tricks
 
Statim, time series interface for Perl.
Statim, time series interface for Perl.Statim, time series interface for Perl.
Statim, time series interface for Perl.
 
"Работа с утечками в V8", Роман Кривцов, MoscowJS 19
"Работа с утечками в V8", Роман Кривцов, MoscowJS 19"Работа с утечками в V8", Роман Кривцов, MoscowJS 19
"Работа с утечками в V8", Роман Кривцов, MoscowJS 19
 
Kubernetes Nedir?
Kubernetes Nedir?Kubernetes Nedir?
Kubernetes Nedir?
 
A quick preview of WP CLI - Chennai WordPress Meetup
A quick preview of WP CLI - Chennai WordPress MeetupA quick preview of WP CLI - Chennai WordPress Meetup
A quick preview of WP CLI - Chennai WordPress Meetup
 
JEP 286 Local-Variable Type Inference - Ted's Tool Time
JEP 286 Local-Variable Type Inference - Ted's Tool TimeJEP 286 Local-Variable Type Inference - Ted's Tool Time
JEP 286 Local-Variable Type Inference - Ted's Tool Time
 
Exec Sp
Exec SpExec Sp
Exec Sp
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
The Directions Pipeline at Mapbox - AWS Meetup Berlin June 2015
The Directions Pipeline at Mapbox - AWS Meetup Berlin June 2015The Directions Pipeline at Mapbox - AWS Meetup Berlin June 2015
The Directions Pipeline at Mapbox - AWS Meetup Berlin June 2015
 

More from application developer (20)

Chapter 26
Chapter 26Chapter 26
Chapter 26
 
Chapter 25
Chapter 25Chapter 25
Chapter 25
 
Chapter 23
Chapter 23Chapter 23
Chapter 23
 
Assignment
AssignmentAssignment
Assignment
 
Next step job board (Assignment)
Next step job board (Assignment)Next step job board (Assignment)
Next step job board (Assignment)
 
Chapter 19
Chapter 19Chapter 19
Chapter 19
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
 
Chapter 17
Chapter 17Chapter 17
Chapter 17
 
Chapter 16
Chapter 16Chapter 16
Chapter 16
 
Week 3 assignment
Week 3 assignmentWeek 3 assignment
Week 3 assignment
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
C # test paper
C # test paperC # test paper
C # test paper
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Chapter 8 part2
Chapter 8   part2Chapter 8   part2
Chapter 8 part2
 
Chapter 8 part1
Chapter 8   part1Chapter 8   part1
Chapter 8 part1
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 

Week 1 Assignment Q2 Solution

  • 1. BookStore.CS using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace ConsoleApplication1 { public delegate void EditionHandler(); public class Book { public string Title; // Title of the book. public string Author; // Author of the book. public string BookType; //Type of Book public decimal Price; // Price of the book. public bool Paperback; // Is it paperback? public EditionHandler AddEdition; public Book(string title, string author, decimal price, bool paperBack) { Title = title; Author = author; Price = price; Paperback = paperBack; } public void ShowEditions() { if (AddEdition != null) AddEdition(); } } public delegate void PrintBook(Book book); public class BookDB { // List of all books in the database: ArrayList list = new ArrayList(); // Add a book to the database: public void AddBook(string title, string author, decimal price, bool paperBack) { list.Add(new Book(title, author, price, paperBack)); } // Call a passed-in delegate on each paperback book to process it: public ArrayList List
  • 2. { get { return list; } } public void PrintPaperBackBooks() { decimal TotalPrice = 0, AveragePrice = 0, ctr = 0; foreach (Book b in list) { if(b.Paperback) { Console.WriteLine(" Book Name {0}", b.Title); Console.WriteLine(" Book Author {0}", b.Author); Console.WriteLine(" Book Price {0:C}", b.Price); Console.WriteLine(" Book Paperback {0}", b.Paperback); Console.WriteLine("n"); TotalPrice = TotalPrice + b.Price; ctr++; } } AveragePrice = TotalPrice / ctr; Console.WriteLine("Average of Paper Back Books is : {0:C}", AveragePrice); } public void PrintAllBooks() { foreach (Book b in list) { Console.WriteLine(" Book Name {0}", b.Title); Console.WriteLine(" Book Author {0}", b.Author); Console.WriteLine(" Book Price {0}", b.Price); Console.WriteLine(" Book Paperback {0}", b.Paperback); Console.WriteLine("n"); } } } }
  • 3. Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { BookDB bookDB = new BookDB(); // Initialize the database with some books: AddBooks(bookDB); printHeader(); bookDB.PrintPaperBackBooks(); Book b1 = (Book)bookDB.List[0]; b1.AddEdition = Edition1; b1.AddEdition += Edition2; b1.AddEdition += Edition3; b1.ShowEditions(); } static void printHeader() { Console.WriteLine("Printing Book Details as on {0}", DateTime.Now.ToString("dd-MMM-yyyy")); Console.WriteLine("n"); } static void AddBooks(BookDB bookDB) { bookDB.AddBook("The C Programming Language", "Brian W. Kernighan and Dennis M. Ritchie", 19.95m, true); bookDB.AddBook("The Unicode Standard 2.0", "The Unicode Consortium", 39.95m, true); bookDB.AddBook("The MS-DOS Encyclopedia", "Ray Duncan", 129.95m, false); bookDB.AddBook("Dogbert's Clues for the Clueless", "Scott Adams", 12.00m, true); } static void Edition1() { Console.WriteLine("Edition1 added"); }
  • 4. static void Edition2() { Console.WriteLine("Edition2 added"); } static void Edition3() { Console.WriteLine("Edition3 added"); } } }