Posts

Showing posts from June, 2024

Console app: Building a Library Management System in C#

Image
Introduction In this blog post, I will guide you through creating a simple Library Management System in C# that utilizes the concepts of encapsulation, polymorphism, and inheritance. This exercise is perfect for practicing object-oriented programming principles. Objective Create a simple Library Management System that demonstrates encapsulation, polymorphism, and inheritance. Requirements 1. Encapsulation    Create a `Book` class with private properties: `Title`, `Author`, `ISBN`, and `IsAvailable`.    Provide public methods to get and set these properties as needed. 2. Inheritance    Create a base class `LibraryItem` with common properties such as `ID`, `Title`, and `IsAvailable`.    The `Book` class should inherit from `LibraryItem`.    Create another derived class `Magazine` that inherits from `LibraryItem` and has additional properties such as `IssueNumber` and `Publisher`. 3. Polymorphism Create a method `DisplayDetails` in the `LibraryItem` class that can be overridden by the der

Angular : simple contact list

Image
Introduction In this blog post, I will demonstrate how to create a simple contact list application using Angular. This application allows users to add, view, and delete contacts. It is a great project for those looking to get started with Angular and understand the basics of data binding, event handling, and component interaction. Features Add new contacts View the list of contacts Delete contacts Getting Started To get started, ensure you have Angular CLI installed. You can create a new Angular project using the following command: ng new contact-list-app Navigate to your project directory cd contact-list-app Code Snippet Below is a snippet of the main component code for the contact list application. This includes the component decorator and the logic for managing the contacts. import { Component } from '@angular/core'; import {FormsModule} from "@angular/forms"; import {NgForOf} from "@angular/common"; in