Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this Inb, you are going to draw soma Ascil Art using a two dimensional array. When dealing with multi- dimensional arrays, you'll typically une

image text in transcribed
In this Inb, you are going to draw soma Ascil Art using a two dimensional array. When dealing with multi- dimensional arrays, you'll typically une nosted loops (L. a loop within a loop). The outer loop typical Rorates over the rows of the array, while the inner loop typically Iterates over the columns A two dimensional array uses two indexes. The first Index represents the row number, while the second Index represents the column. For example: my maydo 11 refers to the first row (0) and the second column Your Tasks 1) Open your IDE and start a new project. 2) Copy and paste the appropriate version of the make_forward() method from page 3 below. This method creates and returns a two-dimensional array of characters with some Asol Art in it 3) In your main method, create a two-dimensional array of characters with 4 rows and 13 columns. 4) Call the make_forward() method and store the result in your new array 5) Using loops, print out the array contents character by character. You should see Ascil An. 6) Write a new method called make_mirror(). It should take a two-dimensional array as a parameter and retum a mirrored version of that 2D array. t.e. The contents of each row should be reversed as follows: 1.) Input array cell (OJOJ should be copied to celoj[12] in the retum array. likewise cel 011) should be copied to cell [0][11] - celt op 12) should be copied to call follo 2. b) Cell 1990 will be copied to cell [1][12], cel [1][1] should be copied to cell 111etc. I 3. c) The same is true for the other two rows d) As you copy each character, check the table below to see if the character itself needs to be reversed. W the character is not in the table, copy it as normal, but if it is in the table, replace it with the Mirrored character. You will need if statements for this Old Character Mirrored Character OX A {backslash-above enter key) i (backslash-above enter key? Note: The backslash (l) has special meaning it means to escape the next character that's typed. For example, you want to set a variable x to you would write charx This is because quotes are used when specifying a character. If you wish to print or compare a backslash itself, you'll need to escape, so you'll actually have to write ML So, for example, to set a variable x to 1, you'd write charx You'll need this when swapping forward slashes and backslashes. There are examples of escaping in the provided make_forward() method. 7) in your main method, create another 2d array of characters of the same size (4x13). Call the make mirror method, passing it the anginal array returned from the make_forward() method. Store the result in your new array rint out the mirrored 2D array By Finally in your main method, print the forward and mirrored image on the same lines. so that they fade each others having a head on coon see below

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

EXPLAIN the strategic importance of total rewards.

Answered: 1 week ago