Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package zadanie4;
- /**
- *
- * @author peroxicz
- */
- public class Rzeczywiste {
- public double real;
- public Rzeczywiste(double real){
- this.real=real;
- }
- public void setReal(double real) {
- this.real = real;
- }
- public Rzeczywiste Dodaj(Rzeczywiste A){
- return new Rzeczywiste(this.real + A.real);
- }
- public Rzeczywiste Odejmij(Rzeczywiste A){
- return new Rzeczywiste(this.real - A.real);
- }
- public Rzeczywiste Pomnoz(Rzeczywiste A){
- return new Rzeczywiste(this.real * A.real);
- }
- public Rzeczywiste Podziel(Rzeczywiste A){
- return new Rzeczywiste(this.real / A.real);
- }
- public Rzeczywiste Kwadrat(Rzeczywiste A){
- return new Rzeczywiste(this.real*this.real);
- }
- public double getReal() {
- return real;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement