sowamaciej

Untitled

Jul 3rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using System;
  2.  
  3. namespace bookapp
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. ksiazka obiekt = new ksiazka(30, 40);
  10. Console.WriteLine("Ksiazke przeczytam w: " + obiekt.Sekundy(100) + "sekund");
  11. Console.ReadLine();
  12. }
  13. }
  14. class ksiazka
  15. {
  16. int IloscStron;
  17. double Cena;
  18. public double GetCena()
  19. {
  20. return Cena;
  21. }
  22. public double Sekundy(int s)
  23. {
  24. double Wynik = s * IloscStron;
  25. return Wynik;
  26.  
  27. }
  28. public void SetIloscStron(int Strony)
  29. {
  30. IloscStron = Strony;
  31. }
  32.  
  33. public ksiazka(int ilosc, double dolan)
  34. {
  35. IloscStron = ilosc;
  36. Cena = dolan;
  37.  
  38.  
  39. }
  40.  
  41.  
  42.  
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment