-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHardCover.cs
More file actions
33 lines (29 loc) · 1004 Bytes
/
Copy pathHardCover.cs
File metadata and controls
33 lines (29 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
namespace BookLibrary
{
// Represents a hardcover book, which is stored in the library
public class HardCover : IBook
{
public required string Title { get; set; } // Title of the book
public bool IsBorrowed { get; private set; } = false; // Borrowed status
public string Location { get; set; } = "Library"; // Location of the book
// Marks the book as borrowed and changes location to "Client"
public void MarkAsBorrowed()
{
IsBorrowed = true;
Location = "Client";
}
// Marks the book as returned and changes location to "Library"
public void MarkAsReturned()
{
IsBorrowed = false;
Location = "Library";
}
// Returns the current location of the book
public string GetLocation() => Location;
}
}