Explain the highlighted part. Like a step-by-step process of completing the requested task. Part 1 Most of
Fantastic news! We've Found the answer you've been seeking!
Question:
Explain the highlighted part. Like a step-by-step process of completing the requested task.
Transcribed Image Text:
Part 1 Most of part 1 will consist of refactoring the code to improve its implementation. Part 1: Setting the turtle size when it is instantiated 1. Currently, a turtle is created and given a default size of 20. To change the size of the turtle its increase Turtle Size By5 and decrease Turtle Size By5 methods can be called. Add functionality so that a turtle can be created with a specified size. In the Doodle Turtle class do the following: a. Overload the Doodle Turtle constructor by creating a one-parameter constructor that takes the size of the turtle as an integer. b. Add an empty method body. c. Complete the method specification for the new constructor. The default constructor method specification can be used as a model. The only difference will be that the getTurtleSize() will equal the name of the size parameter instead of INITIAL_SIZE. d. In the method body of the one-parameter constructor do the following in this order: i. Call the initializeWithDefaultValues helper method. ii. Call the setSize method passing it the size parameter. e. Compile the program and fix any compilation errors before continuing. 2. With the new one-parameter constructor that takes the size of the turtle, we can modify the instantiation of the turtles. In the Gui class in the edu.westga.cs1301.project1.view package. Do the following: a. In the Gui constructor, for the instantiation of the first turtle replace the call to the Doodle Turtle default constructor with a call to the one-parameter constructor and pass in a size of 30. b. Do the same for the second turtle but give it a size of 15. 3. In the Doodle Controller default constructor do the following: a. The size of the turtles no longer need to be changed, so delete the method calls to increase and decrease the size of the big and little turtle, respectively. b. Modify the @param description for big Turtle to say the bigger of the two turtles and likewise for the little Turtle parameter to say the smaller of the two turtles. 2 of 12 Part 1 Most of part 1 will consist of refactoring the code to improve its implementation. Part 1: Setting the turtle size when it is instantiated 1. Currently, a turtle is created and given a default size of 20. To change the size of the turtle its increase Turtle Size By5 and decrease Turtle Size By5 methods can be called. Add functionality so that a turtle can be created with a specified size. In the Doodle Turtle class do the following: a. Overload the Doodle Turtle constructor by creating a one-parameter constructor that takes the size of the turtle as an integer. b. Add an empty method body. c. Complete the method specification for the new constructor. The default constructor method specification can be used as a model. The only difference will be that the getTurtleSize() will equal the name of the size parameter instead of INITIAL_SIZE. d. In the method body of the one-parameter constructor do the following in this order: i. Call the initializeWithDefaultValues helper method. ii. Call the setSize method passing it the size parameter. e. Compile the program and fix any compilation errors before continuing. 2. With the new one-parameter constructor that takes the size of the turtle, we can modify the instantiation of the turtles. In the Gui class in the edu.westga.cs1301.project1.view package. Do the following: a. In the Gui constructor, for the instantiation of the first turtle replace the call to the Doodle Turtle default constructor with a call to the one-parameter constructor and pass in a size of 30. b. Do the same for the second turtle but give it a size of 15. 3. In the Doodle Controller default constructor do the following: a. The size of the turtles no longer need to be changed, so delete the method calls to increase and decrease the size of the big and little turtle, respectively. b. Modify the @param description for big Turtle to say the bigger of the two turtles and likewise for the little Turtle parameter to say the smaller of the two turtles. 2 of 12
Expert Answer:
Related Book For
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
a. Over a two year time horizon an investor experiences the following net cash flows: Year 0 1 2 Cash flow -$8,000 $5,280 $5,320 What is the internal rate of return for the investor? Demonstrate that...
-
What survey design is used in each of these situations? a. A random sample of n = 50 city blocks is selected, and a census is done for each single-family dwelling on each block. b. The highway patrol...
-
Zirconium, Zr, and hafnium, Hf, are metals. An isotope of zirconium has 40 protons and 91 nucleons. a. i. Write the isotopic symbol for this isotope of zirconium. ii. How many neutrons are present in...
-
Can a patient consent to a procedure and then withdraw it? Discuss your answer.
-
1. How does virtualization work? In your own words, describe what you understand about the virtualization process as depicted in the case. 2. In software development and testing, where does...
-
Marco Company shows the following costs for three jobs worked on in April. Job 3 0 6 Job 3 0 7 Job 3 0 8 Balances on March 3 1 Direct materials used ( in March ) $ 3 1 , 8 0 0 $ 3 7 , 8 0 0 Direct...
-
Write VHDL code for an N-but add/sub-component which adds when the select input is 0 and subtracts when it is 1. Please do this using dataflow modeling. Please provide two ways to solve it. The first...
-
On July 1, 2015, Roberts Corporation issued 3,000,000 of 9% bonds payable in 20 years. The bonds include warrants giving the bondholder the right to purchase for 30 one ordinary share of 1 par value...
-
An intangible asset with an estimated useful life of 30 years was acquired on January 1, 2005, for $540,000. On January 1, 2015, a review was made of intangible assets and their expected service...
-
On July 1, 2015, Wheeler Company purchased 4,000,000 of Duggen Companys 8% bonds, due on July 1, 2022. The bonds, which pay interest semiannually on January 1 and July 1, were purchased for 3,500,000...
-
In January 2014, installation costs of 6,000 on new equipment were charged to Maintenance and Repairs Expense. Other costs of this equipment of 30,000 were correctly recorded and have been...
-
Sophia Co., a cellular phone company based in Italy, prepares its financial statements in accordance with IFRS. In 2015, it reported average assets of 12,500 and net income 1,125. Included in net...
-
You need to make a presentation about PERSONAL DIGITAL REVOLUTION
-
6 (a) Briefly develop a mathematical model of the behaviour of a copper-twisted pair cable (b) Derive the magnetic energy from: w given that: K + w, where the - - k symbols have their usual meaning...
-
Why are none of the bulbs in Figure 31. 24 lit? Data from Figure 31. 24 Figure 31.24 (1) (iii) NNN
-
In Figure 31. 26, bulb B is brighter than bulb C, which in turn is brighter than bulb A. Rank, largest first, \((a)\) the magnitudes of the potential differences across the bulbs, \((b)\) the...
-
In Figure 31. 25, identify the energy conversions that occur between points \(A\) and \(B, B\) and \(\mathrm{C}, \mathrm{C}\) and \(\mathrm{D}\), and \(\mathrm{D}\) and \(\mathrm{A}\). Data from...
Study smarter with the SolutionInn App