#A4# #Shape# ## ## #area# ## #double# #{abstract}# #perimeter# ## #double# ## #print# ## ## #{abstract}# #Circle# ## ## #center# #Point# ## ## #radius# #double# ## ## #Circle# #constructor# ## #sets center=c and radius=r# #c# #Point# ## ## #r# #double# ## #center=c and radius=r# #area# ## #double# #result = PI*radius*radius# #perimeter# ## #double# #return 2*PI*radius# #print# ## ## #output Circle( center=...., radius = ....)# ## ## #Point# ## ## #x# #double# ## ## #y# #double# ## ## #Point# #constructor# ## #sets x=x0 and y=y0# #x0# #double# ## ## #y0# #double# ## ## #Point# #constructor# ## #default# #Point# #constructor# ## #copy constructor# #p# #Point# ## ## #print# ## ## # prints Point( x , y )# #Square# ## ## #side# #double# ## ## #bottomLeft# #Point# ## ## #Square# #constructor# ## #sets bottomLeft=bl and side=s# #bl# #Point# ## ## #s# #double# ## ## #area# ## #double# ## #perimeter# ## #double# ## #print# ## ## #outputs Square( .... )# ## ## #Rectangle# ## ## #height# #double# ## ## #bottomLeft# #Point# ## ## #base# #double# ## ## #Rectangle# #constructor# ## #sets bottomLeft = bl and base=b and height=h# #bl# #Point# ## ## #b# #double# ## ## #h# #double# ## ## #area# ## #double# #result= height*base# #perimeter# ## #double# #result = 2*(base+height)# #print# ## ## #outpus Rectangle ( bottomLeft = ...., base = ...., height= ....)# ## ## #EquilateralTriangle# ## ## #side# #double# ## ## #bottomLeft# #Point# ## ## #EquilateralTriangle# #constructor# ## #sets bottomLeft=bl and side=s# #bl# #Point# ## ## #s# #double# ## ## #area# ## #double# #result=sqrt(3)*side*side/4# #perimeter# ## #double# #result=3*side# #print# ## ## #outputs EquilateralTriangle ( bottomLeft= ..., side=....)# ## ## #const double PI=4.0*atan(1.0)# ## #1# #1# #1# #1# #center# #bottomLeft# #bottomLeft# #bottomLeft#