Write a function to generate and return a 2d array

Assignment Help Basic Computer Science
Reference no: EM13892630

Python 3.5

1. Write a function to generate and return a 2D array (i.e. a two dimension list) filled with underscores "_" given the number of rows and the number of columns where the number of rows does not necessarily equal the number of columns. An empty array 3 x 5 array would look like:

_ _ _ _ _
_ _ _ _ _
_ _ _ _ _

Write a function to print a 2D array to the console with one space between items in a row given the array.

Write a function to fill in all cells on and below the left to right diagonal of an array given the array. The left to right diagonal always starts at (0,0). A filled cell in an array will be represented by a capital letter ( I choose my initial, Z, as my fill character). Output should be similar to the following; using the fill character of your choice. Some examples are:

Z _ _ _ _

Z Z _ _ _

Z Z Z _ _

Z Z Z Z _

Z Z Z Z Z

 

Z _ _ _ _

Z Z _ _ _

Z Z Z _ _

 

Z _ _

Z Z _

Z Z Z

Z Z Z

Z Z Z

The main program should prompt the user for the dimensions of the test arrays. Test the function by generating an empty array, filling the cells below the left to right diagonal and printing the array. 

Test with 3 arrays: one square array, one where there are more columns than rows, and one where there are more rows than columns; rows and columns must be a minimum of 3 for all test cases 

Reference no: EM13892630

Questions Cloud

Unadjusted trial balance and information for the accounting : 1.The unadjusted trial balance and information for the accounting adjustments of Noseworthy Investigators follow.
What would be the best way for an electrical : What would be the best way for an electrical engineer to enter the automotive industry?
What is the difference between inputstream and filereader : WHat is the difference between InputStream and FileReader?
Identify the target population and developmental stage : Identify the target population and developmental stage of the population, as well as the intended program track. (These will be elaborated upon further in the Program Narrative and Procedures section of the proposal.)
Write a function to generate and return a 2d array : 1. Write a function to generate and return a 2D array (i.e. a two dimension list) filled with underscores "_" given the number of rows and the number of columns where the number of rows does not necessarily equal the number of columns. An empty array..
Whom and for whom is an administrator responsible : Briefly describe a scenario in which an administrator's legal and ethical responsibilities might conflict, and moral courage is needed. What would you do in that situation, and why?
Write a term paper about the stroop test of working memory : Write a term paper about "The Stroop Test of working memory".
Prepare a business plan for tawseel l.l.c company : You need to prepare a business plan for Tawseel L.L.C Company -  Short-term Business Objectives.
Opening feature involving arynetta floyzelle : 1.Review this chapter's opening feature involving Arynetta Floyzelle and her Girl Team Mobile business.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  How can buffer-overflow attacks be avoided

How can buffer-overflow attacks be avoided?

  Discuss some options for mobile wireless

Please discuss some options for mobile wireless internet connection, and describe the types of hardware that would be involved in making such a connection

  Compute the overall npv if tangible benefits are given

Tangible benefits of $190,000 per year. If the cost of capital is 12 percent, compute the overall NPV? Overall ROI? Break-even.

  Critique the idea which the cio can be a bridge between

critique the idea that the cio can be a bridge between enterprise finance marketing and sales functions. justify the

  Calculating total addressing capacity of computer system

A computer system uses 20-bit address bus and can address an 8-bit wide memory. The memory of this computer system contains 2 × 32 Kbytes ROM (ROM1, ROM2) and 2 × 16 Kbytes of RAM (RAM1 & RAM2).

  How does disaster recovery planning ensure business continui

How does disaster recovery planning ensure business continuity?

  Consider the social effects of information technologies

Consider the social effects of information technologies.

  Optimal shipments between the european ports and warehouse

Determine the optimal shipments between the European ports and the warehouses and the distribution centers to minimize total transportation costs.

  What values if any are stored in x y z

Suppose you are given the following variable declarations: int x, y; double z; char ch; Assume you have the following input statement

  Explaining slash dotted and flash crowd

What do terms slash dotted and flash crowd signify to?

  Code (sketch) for an arduino uno microcontroller

Code (sketch) for an arduino uno microcontroller that will be connected to an MT8870 decoder chip. This chip decodes the signal it receives from a phone mic as a dtmf (dual tone multiple frequency) signal. Then the decoder chip translates the tones i..

  Design an algorithm that prompts the user to enter a number

Design an algorithm that prompts the user to enter a number in the range of 1 through 100 and validates the input.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd