1. Create class Circle with 2 attributes: radius(whole number), pi(decimal). (6)
a. Create constructor with 1 parameter for radius. Pi has default value – 3.14.
b. Create 1 method that returns the value of the radius.
c. Create method calculateLength() that returns length of the circle. (l=2*pi*r)
d. Create 1 object of the class in Main class. Call method from subtask c.
2. Create and print an array with 5 random elements in a range from 20 to 70.
Remove all even elements and print an array. (6)
Sample random
21 45 60 32 51
Sample output
21 45 51

ako91545 ako91545    1   17.03.2022 12:26    0

Другие вопросы по теме Информатика