Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the code below is for exercise02. the question based exercise02. package exercise02; import javafx.geometry.Point2D; import javafx.scene.shape.Polygon; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; /************************************************************************ * Lab 04 Exercise

image text in transcribed

the code below is for exercise02. the question based exercise02.

package exercise02;

import javafx.geometry.Point2D; import javafx.scene.shape.Polygon; import javafx.scene.layout.Pane; import javafx.scene.paint.Color;

/************************************************************************ *

Lab 04 Exercise 02 * This is a pane for displaying different levels of a Sierpinski * Triangle constructed with line segments. ************************************************************************/ public class LinedSierpinski extends Pane{

/******************************************************** * data field: keeps the value of the current level * of the Sierpinski Triangle. * *****************************************************/ private int level; /********************************************************** * constructor that generates and initializes the * attributes of the Sierpinski Triangle. * ********************************************************/ public LinedSierpinski() { level = 1; } /********************************************************** * validates the level of the Sierpinski Triangle and * returns a valid level. * ********************************************************/ public int checkLevel(int level) { if (level Exercise 02 Questions inspect and run the code in package exercise02 and answer the following questions. Questions How do you obtain the midpoint between two points? State the mathematic formula. y/ What is the end case for the drawFigure method? How many times is the drawFigure method invoked for a Sierpinski triangle of order 4, and 7? What does the checklevel method do? Does this method handle any preconditions? If so, what are they? Explain in at least 3 sentences. (PRINT) Describe the behavior of the getLevel method and setLevel method i.e. what operations do they do? Explain in at least 3 sentences. (PRINT) Exercise 02 Questions inspect and run the code in package exercise02 and answer the following questions. Questions How do you obtain the midpoint between two points? State the mathematic formula. y/ What is the end case for the drawFigure method? How many times is the drawFigure method invoked for a Sierpinski triangle of order 4, and 7? What does the checklevel method do? Does this method handle any preconditions? If so, what are they? Explain in at least 3 sentences. (PRINT) Describe the behavior of the getLevel method and setLevel method i.e. what operations do they do? Explain in at least 3 sentences. (PRINT)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago

Question

5. Describe the relationship between history and identity.

Answered: 1 week ago