This commit is contained in:
2026-03-17 16:46:05 +01:00
parent ee70d90785
commit 020939d1e3
8 changed files with 126 additions and 15 deletions

View File

@@ -1,3 +1,21 @@
#include <iostream>
#include <string>
int main() {}
class Produkt {
std::string nazwa;
float cena;
public:
void ustawNazwe(std::string nazwa) { this->nazwa = nazwa; }
void ustawCene(float cena) { this->cena = cena; }
void pokaz() {
std::cout << "Produkt " << nazwa << " kosztuje " << cena << " zł.";
}
};
int main() {
Produkt p;
p.ustawNazwe("Marchewka");
p.ustawCene(234.342);
p.pokaz();
}