Create a new console application which includes the Book class, with its attributes and operations as shown in the UML class diagram below:
Book |
- title: string - author: string - publisher: string |
+ GetTitle(): string + SetTitle(tle: string):void + GetAuthor(): string + SetAuthor(au: string):void + GetPublisher(): string + SetPublisher(pub: string):void |
Your program should create a new book object, obtain the title, author and publisher from the user, which are then assigned to the object’s fields using the appropriate methods. The program should then display the book information as shown in the sample below, by calling the appropriate methods.
Question 2
Redesign the UML class diagram for the Book Class (in question 1) as follows:
· Replace all of the Get and Set methods with; three auto-implemented properties
· Add two Constructors:
o A parameterless
o A parameterised - which has 3 parameters
(title, author, publisher).
This is to be completed in a Microsoft Word document and submitted in the zip file along with all of your Visual Studio projects.
Question 3
Create a completely new console application which also includes a Book class that now matches the updated UML class diagram created above in question 2. (DO NOT change your question 1 application or you will not get marks for it).
This new application should still run as per the program sample given in question 1 however.
Question 4
Create a new console application which includes the Employee class, with its attributes and operations as shown in the UML class diagram below
Your program should obtain the first and last name from the user in order to create a record for a single employee. You will also prompt the user to enter the year they started working for the company.
Then using the appropriate method(s) display the person’s full name and the years worked for the company back to the screen as shown in the sample below: