your task is to make Clara move through the middle row in the world shown in...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
your task is to make Clara move through the middle row in the world shown in Figure 1. and place a leaf in any cell that has a tree either above or below this cell. Clara has to stop when she detects that there is a tree in front of her. The result should look similar to Figure 2. * Figure 1. Figure 2. Starting from this problem, there will be restrictions on commands that you can use in your solutions. Those restrictions will appear at the top of MyClara file as shown in Figure 3. In this problem you are only allowed to use commands shown in Figure 3. Notice that you are not allowed to use turnLeft() and turn Right() commands. 2 3 4 1/* PERMITTED COMMANDS move(); treeLeft (); treeRight(); treeFront (); onLeaf (); putLeaf (); removeLeaf (); stop(); JAVA if, else */ Figure 3. Your solution must be generic and has to work with all supplied example worlds. This means that before submitting you must test your code with all supplied worlds and it must correctly work in all of those. You should also aim at making sure that the code would work with all similar worlds with similar properties (beyond the provided examples). your task is to make Clara move through the middle row in the world shown in Figure 1. and place a leaf in any cell that has a tree either above or below this cell. Clara has to stop when she detects that there is a tree in front of her. The result should look similar to Figure 2. * Figure 1. Figure 2. Starting from this problem, there will be restrictions on commands that you can use in your solutions. Those restrictions will appear at the top of MyClara file as shown in Figure 3. In this problem you are only allowed to use commands shown in Figure 3. Notice that you are not allowed to use turnLeft() and turn Right() commands. 2 3 4 1/* PERMITTED COMMANDS move(); treeLeft (); treeRight(); treeFront (); onLeaf (); putLeaf (); removeLeaf (); stop(); JAVA if, else */ Figure 3. Your solution must be generic and has to work with all supplied example worlds. This means that before submitting you must test your code with all supplied worlds and it must correctly work in all of those. You should also aim at making sure that the code would work with all similar worlds with similar properties (beyond the provided examples).
Expert Answer:
Answer rating: 100% (QA)
It seems like you want to create a program or script to make Clara move through a gridlike world re... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
While traveling at constant speed, a 2100-kg vehicle encounters a banked, horizontal curve of diameter 0.50 km. (a) If the road grade of the bank is 6.0%, determine the angle between the road surface...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Ann Carter, Chief Financial Officer of Consolidated Electric Company (Con El), must make a recommendation to Con Els board of directors regarding the firms dividend policy. Con El owns two...
-
You kick a soccer ball, compressing it suddenly to 2/3 of its original volume. In the process, you do 410 J of work on the air (assumed to be an ideal gas) inside the ball. (a) What is the change in...
-
Trans-2-Buterw is more stable than cic-2-hutene by only 4kJ/mol, but trans-2, 2, 5; 5-tetramethyl-3-hexene is more stable than its cis isomer by 3kJ/mol. Explain.
-
A beam of coherent light of wavelength 623 nm in air is incident on a rectangular block of glass with index of refraction 1.40. If, after emerging from the block, the wave that travels through the...
-
Ollies Outdoor Centre is owned and run by Oliver Baker, using the periodic inventory system and balancing her books at month-end. At 30 April 2025, the balances of the Accounts Receivable Control and...
-
Mae contracted to sell one thousand bushels of wheat to Lloyd at $5.00 per bushel. Just before Mae was to deliver the wheat, Lloyd notified her that he would not receive or accept the wheat. Mae sold...
-
push ('Arabic') push ('French') pop() push ('English') push ('Spanish') 1) Draw this stack (In an array of 5 elements implementation) 2) What is the language given by the Top element? 3) In which...
-
Under what circumstances should a systems analyst recommend an agile methodology over structured development or object-oriented analysis?
-
Discuss the concept of Organizational Learning and its pivotal role in fostering innovation and sustainable growth within businesses. Explore the fundamental principles and mechanisms involved in...
-
The intersection method computes the intersection of two rectanglesthat is, the rectangle that would be formed by two overlapping rectangles if they were drawn, as shown at right. You call this...
-
Write a PerimeterTester program that constructs a Rectangle object and then computes and prints its perimeter. Use the getWidth and getHeight methods. Also print the expected answer.
-
Find the errors in the following if statements: a. b. c. d. e. if x>0 then System.out.print(x);
-
How can you write a method that swaps two floating-point numbers? java.awt.Point.
-
Give the Java code for constructing an object of class Rectangle, and for declaring an object variable of class Rectangle.
-
Find the Horsepower of an aircraft that produces 5,000 lbs ofthrust at 200 KTAS. 1,000,000 HP 1,000,000 Ft-lb 3,077 HP 1000 HP
-
What are the six activities involved in the physical supply/distribution system?
-
Mike purchases a heavy-duty truck (5-year class recovery property) for his delivery service on April 30, 2012. The truck is not considered a passenger automobile for purposes of the listed property...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-4. Ivan and Irene paid the following in 2012 (all by check or can otherwise be...
-
Ulysses and Penelope are married and file separate returns for 2012. Penelope itemizes her deductions on her return. Ulysses' adjusted gross income was $17,400, his itemized deductions were $2,250,...
-
As the Internet continues to grow in its business influence, it is increasingly being used for applications that were formerly client/server based applications. What are some of the similarities in...
-
Fill in the blanks for the following statements: a. Source documents should be portioned into different zones for data, data, and depending upon the system inputs and reviewing form, for data that...
-
Why does the free-rider problem occur in the debt market?
Study smarter with the SolutionInn App