Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Zadanie1
- {
- class Punkt
- {
- public double wspolrzedna_x;
- public double wspolrzedna_y;
- public double wspolrzedna_z;
- public Punkt(double x,double y, double z)
- {
- wspolrzedna_x = x;
- wspolrzedna_y = y;
- wspolrzedna_z = z;
- }
- public void Wyswietl()
- {
- Console.WriteLine("Punkt x: {0}", wspolrzedna_x);
- Console.WriteLine("Punkt y: {0}", wspolrzedna_y);
- Console.WriteLine("Punkt z: {0}", wspolrzedna_z);
- Console.WriteLine();
- Console.WriteLine();
- }
- public void zmien(double nowa_x,double nowa_y, double nowa_z)
- {
- wspolrzedna_x += nowa_x;
- wspolrzedna_y += nowa_y;
- wspolrzedna_z += nowa_z;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Punkt p1 = new Punkt(5, 10, 15);
- p1.Wyswietl();
- p1.zmien(5, 10, 15);
- p1.Wyswietl();
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment