Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. package Blok5;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. public class zad32_sklepik {
  7.  
  8. public static void main(String[] args) {
  9.  
  10.  
  11. }
  12.  
  13. }
  14.  
  15. class Sklep {
  16. public List<Towar> Magazyn = new ArrayList<Towar>();
  17.  
  18. }
  19.  
  20. class Towar {
  21.  
  22. public int nr;
  23. public String kategoria;
  24. public String nazwa;
  25. public int ilosc;
  26. public int cena_jedn;
  27.  
  28. public Towar (int nr, String kategoria, String nazwa, int ilosc, int cena_jedn) {
  29.  
  30. this.nr=nr;
  31. this.kategoria=kategoria;
  32. this.nazwa=nazwa;
  33. this.ilosc=ilosc;
  34. this.cena_jedn=cena_jedn;
  35.  
  36. }
  37.  
  38. public int getNr() {
  39. return nr;
  40. }
  41.  
  42. public String getKategoria() {
  43. return kategoria;
  44. }
  45.  
  46. public String getNazwa() {
  47. return nazwa;
  48. }
  49.  
  50. public int getIlosc() {
  51. return ilosc;
  52. }
  53.  
  54. public int getCena() {
  55. return cena_jedn;
  56. }
  57.  
  58. public int getCenaLaczna() {
  59. return cena_jedn*ilosc;
  60. }
  61.  
  62. }
  63.  
  64. class Koszyk {
  65. public List<Towar> Magazyn = new ArrayList<Towar>();
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement