Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public class Einkaufspostens
  2. {
  3. public static void main(String[] args)
  4. {
  5.  
  6. }
  7. }
  8. abstract class Einkaufsposten{
  9. private String bezeichnung;
  10. private long anzahl;
  11. private double nettoEinzelPreis;
  12.  
  13. public abstract double getBruttoEinzelPreis();
  14. public double getGesamtPreis(){
  15. return anzahl * bruttoEinzelPreis;
  16. }
  17.  
  18. Einkaufsposten(String bezeichnung, long anzahl, double nettoEinzelPreis){
  19. this.bezeichnung = bezeichnung;
  20. this.anzahl = anzahl;
  21. this.nettoEinzelPreis = nettoEinzelPreis;
  22. }
  23. public void setBezeichnung(String bezeichnung){
  24. this.bezeichnung = bezeichnung;
  25. }
  26. public String getBezeichnung(){
  27. return bezeichnung;
  28. }
  29. public void setAnzahl(long anzahl){
  30. this.anzahl = anzahl;
  31. }
  32. public long getAnzahl(){
  33. return anzahl;
  34. }
  35. public void setNettoEinzelPreis(double nettoEinzelPreis){
  36. this.nettoEinzelpreis = nettoEinzelPreis;
  37. }
  38. public double getNettoEinzelPreis(){
  39. return nettoEinzelPreis;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement