Question
Clara World Practical 6 - Expression, methods and arrays Problem 6_2 - Multiple Rooms Hows would write code for question? /* PERMITTED COMMANDS move, turnLeft,
Clara World Practical 6 - Expression, methods and arrays
Problem 6_2 - Multiple Rooms
Hows would write code for question?
/* PERMITTED COMMANDS
move, turnLeft, turnRight, treeLeft, treeRight, treeFront, onLeaf, putLeaf, removeLeaf, mushroomFront
JAVA
if, while, for
*/
Question:
first request the user to enter three integer numbers (room width, room height and the number of rooms). These numbers must be validated so that the house fits inside Clara's world. If any of the numbers does not satisfy this requirement - user must re-enter the corresponding number. When the numbers are correctly entered - Clara must draw the containing the desired number of rooms as shown in Figure 2. Each of the rooms would have the same dimensions (width and height) as entered by the user. In the example from Figure 2 the user has requested to draw a house with three rooms where each of the room has width = 6 and height = 5.
Clara continues to work as an assistant of an architect and her next assignment at the new place is to create a drawing of a house containing multiple rooms. Naturally, all room outlines in Clara's world are made out of leaves. N Figure 1.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
In this task you are helping Clara the character in the world draw rooms based on the input dimensions provided by the user The goal is to validate us...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started