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 hernext assignment at the new place is to create a drawing ofa house containing multiple rooms. Naturally, all room outlines in Clara's world

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

1 Expert Approved Answer
Step: 1 Unlock

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... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!