Explanation of Solution
Given: The class names such as Circle, Square, Triangle, Person, and Canvas.
To find:Â The possible way to create another circle and then a square.
Solution:
Start BlueJ and open a new project named figures.
A new window will appear on the screen in which each rectangular block will represent a class.
In order to create an object of Circle class, it is necessary for the user to right click on the Circle class and then click on the new Circle() from the pop-up menu. The user can provide a specific name of the instance and then click ok button.
A new red rectangle will appear at the bottom of the BlueJ screen labeled with the name of the instance provided by the user.
In order to create an object of Square class, it is necessary for the user to right click on the Square class and then click on the new Square() from the pop-up menu. The user will be prompt to provide a specific name of the instance and then click ok button.
Another red rectangle will appear at the bottom of the BlueJ screen labeled with the name of the instance provided by the user.
Want to see more full solutions like this?
Chapter 1 Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
- please find the area of a triangle in 2 ways given the points A, B, and C. Plot the points A= (0,2,6), B= (8,2,2), and C= (5,6,4) in Geogebra and 1): Use the polygon command: Polygon(A,B,C) --this will give the lengths of the 3 segments of the triangle and then give the area of this triangle 2) Using Heron's Formula: A=s(s−a)(s−b)(s−c) where s=a+b+c2 and the sides of the triangle are a,b,c (these are given in the Polygon command in step 1).arrow_forwardTestCircle• Create a Circle with the radius• Print the radius using the getters• Print the Circle’s area and circumference• Change the circle’s radius• Reprint the informationarrow_forwardyou can only use the lines from the left side and add to right side.arrow_forward
- Why Do We Need Encapsulation? Please explain broadly on why do we need Encapsulationarrow_forwardWhat happens when you open a picture and then change the frame size? What happens if you open a picture after resizing the frame to the desired dimensions?arrow_forward! Just need the blue circled ones which are the formulasarrow_forward
- how would i turn this erd into a code for example it should look something like the second photo and first one is the erdarrow_forward(Please do not give solution in image format thanku) Using Java, Integer variables totalBudget and productCost are read from input. A product costs productCost to make, and a budget is given by totalBudget. Assign remainingBudget with the remaining budget after making as many products as possible.arrow_forwardA unit square is shown below. What will be the image of unit square after horizontal and vertical contraction and expansion.arrow_forward
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage