Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Assignment

Write a console application to meet the following requirements. Create a system for a simple library. The library has a name and a list of books. Each book has a title, author and an int as the id number. Define classes for both the library and the book. The library should have methods for adding a book to the library, to search for a book by title, to display information about all of the books and to delete a book (by title) from the library.

The following conditions apply to the books in the library:

1. Each book's name is unique. There are no duplicate titles. When adding a book, ensure that the title doesn't already exist. If it does exist, don't let the new book be added.

2. There is only one copy of each book in the library.

3. An author may have more than one book in the library.

Complete the code in this incomplete client designed to test the classes and their functionality. You should not change any of the other code in main.

class MainClass

{

public static void Main (string[] args)

{

Library lib = new Library ();

lib.AddBook ("C# *****", "Gesick", 4);

lib.AddBook ("java programming", "Roth", 2);

lib.AddBook ("C++ programming", "Franklin", 1);

lib.AddBook ("unity programming", "Preston", 3);

lib.AddBook ("graphics & multimedia", "Chastine", 5);

printMenu ();

string p = Console.ReadLine ();

p = p.ToUpper ();

char pick = p [0];

while (pick!='Q') {

switch (pick) {

case 'A':

//insert code here for adding a book

break;

case 'S':

//insert code here for finding a book and

//printing its details

break;

case 'D':

//insert code here for displaying all of the books in the library break;

case 'R':

//insert code here for removing a book break;

default:

Console.WriteLine ("\nInvalid choice, please re-enter");

break;

}

printMenu ();

p = Console.ReadLine ();

p = p.ToUpper ();

pick = p [0];

}

Console.WriteLine ("good bye");

}

public static void printMenu ()

{

Console.WriteLine ("\nSelect one of the following:\n\n" +

" A to add a book to the library\n" +

" S to search for a book by title\n" +

" D to display the contents of the library\n" +

" R to remove a book from the library\n" +

" Q to quit this program\n\n");

Console.Write ("enter choice here: ");

}

}

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92076496
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Programming Language

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As