1 / 2

Exercise: Two-dimensional Arrays

Exercise: Two-dimensional Arrays. Write a program that displays the letter ‘V’ in a two-dimensional array, using the asterisk ‘*’ Use command line arguments input the size of a two-dimensional square array. Assume the size is at least 5.

vito
Download Presentation

Exercise: Two-dimensional Arrays

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Exercise: Two-dimensional Arrays • Write a program that displays the letter ‘V’ in a two-dimensional array, using the asterisk ‘*’ • Use command line arguments input the size of a two-dimensional square array. Assume the size is at least 5. (Avoid using an int type of command-line argument. use String instead. Then use parseInt to extract the integer from this String argument.) • Draw a big ‘V’ in the array (use the asterisk ‘*’ the appropriate cells) • Print the array (use nested loops)

  2.     For an array of size 5, the ‘V’ should look like this: Note that the array size may be an even number

More Related