33 lines
812 B
C#
33 lines
812 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Warenkorb
|
|
{
|
|
abstract class Article
|
|
{
|
|
private int articleNumber;
|
|
private double price;
|
|
public Article(int articleNumber, double price)
|
|
{
|
|
this.articleNumber = articleNumber;
|
|
this.price = price;
|
|
}
|
|
public virtual double GetPrice()
|
|
{
|
|
return this.price;
|
|
}
|
|
public virtual int GetarticleNumber()
|
|
{
|
|
return this.articleNumber;
|
|
}
|
|
public virtual void PrintInfo()
|
|
{
|
|
Console.WriteLine($"Artikelnummer: {GetarticleNumber()}");
|
|
Console.WriteLine($"Nettopreis: {this.price:C2}");
|
|
}
|
|
}
|
|
}
|