Creating MountainScape is what the question needs, the other screenshot is the code that we have already and needed to modify to add MountainScape into the original code to get that "mountain" shape...


Creating MountainScape is what the question needs, the other screenshot is the code that we have already and needed to modify to add MountainScape into the original code to get that "mountain" shape


class Landscape<br>{<br>private String terrainString;:<br>Landscape ()<br>{<br>terrainString<br>}<br>public void flat (int length0fFlatPortions)<br>{<br>for (int count = 0; count < lengthOfFlatPortions; count++)<br>{<br>terrainString +=<br>}<br>}<br>public void hill (int lengthofHillTop) {<br>terrainString +=

Extracted text: class Landscape { private String terrainString;: Landscape () { terrainString } public void flat (int length0fFlatPortions) { for (int count = 0; count < lengthofflatportions;="" count++)="" {="" terrainstring="" +="}" }="" public="" void="" hill="" (int="" lengthofhilltop)="" {="" terrainstring="" +="/" :="" for="" (int="" count="0;" count="">< length0fhilltop;="" count++)="" terrainstring="" +="terrainString" +="\\" :="" }="" public="" void="" print="" )="" {="" system.="" out.="" println(terrainstring);="" }="" }="" class="" test3="" {="" public="" static="" void="" main(string[]="" args)="" {="" lands="" cape="" lands="" cape="new" landscape="" );="" lands="" cape.="" flat(3);="" lands="" cape.="" hi="" ll="" (4);="" lands="" cape.="" flat="" (2)="" lands="" cape.="" hill="" (3)="" lands="" cape.="" flat(4)="" lands="" cape.="" hill="" (0);="" lands="" cape.="" flat="" (1);="" landscape.="" print="" ();="">
For problem 2 create a new class called MountainScape that has not only the flat () and hill () methods but also a<br>mountain () method. The output will now represent three lines of output text. Specifically, modify the code so that the following<br>build script will produce the output shown.<br>= new MountainScape ();<br>MountainScape mountainscape<br>//BUILD SCRIPT<br>mountainscape.flat (3);<br>mountainscape.mountain (3);<br>mountainscape.flat (2);<br>mountainscape.mountain (0);<br>mountainscape.flat (4);<br>mountainscape.hill (1);<br>mountainscape.flat (1);<br>//END SCRIPT<br>mountainscape.print ();<br>Output:<br>

Extracted text: For problem 2 create a new class called MountainScape that has not only the flat () and hill () methods but also a mountain () method. The output will now represent three lines of output text. Specifically, modify the code so that the following build script will produce the output shown. = new MountainScape (); MountainScape mountainscape //BUILD SCRIPT mountainscape.flat (3); mountainscape.mountain (3); mountainscape.flat (2); mountainscape.mountain (0); mountainscape.flat (4); mountainscape.hill (1); mountainscape.flat (1); //END SCRIPT mountainscape.print (); Output:

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here