您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Extend Index

Extend Page # 7

Extension Activity 4 – Area calculation for different shapes

Run the "CircleSquare" application. A window should open, presenting at the top, buttons to choose either "circle1" or "square1", on the left a set of buttons to send messages and on the right a drawing area showing a small, black circle, and below it a small, black square. Your computer should look similar to the screen shot in the figure below:

image37.gif (5322 bytes)

You can select which object messages will be sent to by clicking the radio button next to the object name "circle1" or "sqaure1".

By clicking the appropriate message buttons perform the following tasks on the circle object:

(1) make circle1 red

(2) make square1 blue

(3) make circle1 larger

(4) make square1 larger

(5) find out the radius of circle1

(6) find out the radius of square1

(7) find out the length of sides of square1

(8) find out the length of sides of square2

(9) find out the area of circle1

(10) find out the area of square1

Discussion of Extension Activity 4

Back to Extend

Back to top

 basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg