Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Einkaufspostens
- {
- public static void main(String[] args)
- {
- }
- }
- abstract class Einkaufsposten{
- private String bezeichnung;
- private long anzahl;
- private double nettoEinzelPreis;
- public abstract double getBruttoEinzelPreis();
- public double getGesamtPreis(){
- return anzahl * getBruttoEinzelPreis();
- }
- Einkaufsposten(String bezeichnung, long anzahl, double nettoEinzelPreis){
- this.bezeichnung = bezeichnung;
- this.anzahl = anzahl;
- this.nettoEinzelPreis = nettoEinzelPreis;
- }
- public void setBezeichnung(String bezeichnung){
- this.bezeichnung = bezeichnung;
- }
- public String getBezeichnung(){
- return bezeichnung;
- }
- public void setAnzahl(long anzahl){
- this.anzahl = anzahl;
- }
- public long getAnzahl(){
- return anzahl;
- }
- public void setNettoEinzelPreis(double nettoEinzelPreis){
- this.nettoEinzelpreis = nettoEinzelPreis;
- }
- public double getNettoEinzelPreis(){
- return nettoEinzelPreis;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement