Files
SammelmappeOOP/Warenkorb/Books.cs
2024-07-25 15:47:46 +02:00

37 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Warenkorb
{
internal class Books : Article
{
private string author;
private string title;
private string yearOfPublishing;
private double vat = 1.07;
//Books(int articleNumber, double price,)
public Books(int articleNumber, double price, string author, string title, string yearOfPublishing) : base(articleNumber, price)
{
this.author = author;
this.title = title;
this.yearOfPublishing = yearOfPublishing;
}
public override double GetPrice()
{
return base.GetPrice()*vat;
}
public override void PrintInfo()
{
base.PrintInfo();
Console.WriteLine($"Brutto: {GetPrice():C2}");
Console.WriteLine($"Autor: {this.author}");
Console.WriteLine($"Titel: {this.title}");
Console.WriteLine($"Erscheinungsjahr: {this.yearOfPublishing}");
}
}
}