Add Papers Marked0
Paper checked off!

Marked works

Viewed0

Viewed works

Shopping Cart0
Paper added to shopping cart!

Shopping Cart

Register Now

internet library
Atlants.lv library
FAQ
6,49 € Add to cart
Add to Wish List
Want cheaper?
ID number:622121
 
Evaluation:
Published: 22.09.2007.
Language: Latvian
Level: College/University
Literature: n/a
References: Not used
Extract

-- Abstraktā klase "figūra" - neveidojam tieši šīs klases objektus, bet veidojam objektus
-- no tās atvasinātajām klasēm
deferred class FIGURE
feature
-- nākamās četras klases ir abstraktas, tāpēc katras atvasinātas klases objektiem laukumi, perimetri,
-- smaguma centri un nobīdes par vektoru tiek rēķinātas savādāk
getArea: REAL is deferred end
getPerimeter: REAL is deferred end
getGravity: POINT is deferred end
getVector(p: POINT) is deferred end
end

Punktu klase

class POINT
inherit SINGLE_MATH
create make_xy
feature
-- Punkta koordinātes
x,y: REAL
-- Funkcija, kas aprēķina attālumu no punkta līdz citam punktam
getLength(p1:POINT): REAL is do
Result := sqrt((x - p1.x)^2 + (y - p1.y)^2)
end
-- Nobīde par vektoru
translate(a,b:REAL) is do x:=x+a; y:=y+b end…

Author's comment
Load more similar papers

Atlants

Choose Authorization Method

Email & Password

Email & Password

Wrong e-mail adress or password!
Log In

Forgot your password?

Draugiem.pase
Facebook

Not registered yet?

Register and redeem free papers!

To receive free papers from Atlants.com it is necessary to register. It's quick and will only take a few seconds.

If you have already registered, simply to access the free content.

Cancel Register