Modify this code so that it uses the '_' underscore character for both the flat portions and the tops of the hills. public class Landscape { private String terrainString; Landscape () { terrainString...


Modify this code so that it uses the '_' underscore character for both the flat portions and the tops of the hills.


public class Landscape {<br>private String terrainString;<br>Landscape () {<br>terrainString =

Extracted text: public class Landscape { private String terrainString; Landscape () { terrainString = ""; } public void flat (int lengthOfFlatPortion) { for (int count = 0; count < lengthofflatportion;="" count++)="" {="" terrainstring="" +=" " ;="" }="" }="" public="" void="" hill="" (int="" lengthofhilltop)="" {="" terrainstring="" +="/" ;="" for="" (int="" count="0;" count="">< lengthofhilltop;="" count++)="" terrainstring="" +="'" ;="" terrainstring="" +="\\" ;="" }="" public="" void="" print="" ()="" {="" system.out.println="" (terrainstring);="" }="" public="" class="" main="" {="" public="" static="" void="" main="" (string="" []="" args)="" {="" landscape="" landscape="new" landscape="" ();="" build="" landscape="" script="" landscape.flat(3);="" landscape.hill="" (4);="" landscape.flat(6);="" landscape.hill(1);="" landscape.flat="" (1);="" end="" script="" landscape.print="" ();="">
produces output that looks like this:<br>

Extracted text: produces output that looks like this:

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here