add Programmyday form github
This commit is contained in:
36
Warenkorb/Books.cs
Normal file
36
Warenkorb/Books.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user