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

  Multiplexors whose control bit allows

Multiplexors whose control bit allows you to select between one of two modes right shift or left shift. Include logic to perform arithmetic shift left and arithmetic shift right . This means you must include logic to perform sign extension in ..

  Develop a training schedule for hoosier burgers end users

Develop a training schedule for Hoosier Burger's end users, develop a hardware and software installation schedule for Hoosier Burger and develop User Documentation for the Delivery Customer Order Form.

  Prepare gross pay and net pay functions for valid user name

Prepare gross pay and net pay functions, and give user input validation to check for valid user name. Hours worked is between 0 and 80 hours, and hourly wage is between $8.95 and $50.

  Recognize interface metaphor to use for conceptual design

For conceptual design (architectural or high-level), recognize the interface metaphor to use, interaction type(s) to employ, and interface type(s) to follow. For each of these, make sure to describe why you select what you did.

  What would be the output of the countdown routine

Recursion is a powerful technique that is often utilized for a variety or problems. Often, people think iteratively rather than recursively. However, when thinking computationally, as in computer language, recursive techniques are often utilized.

  Create a list of the top-five utilities computer should have

Create a list of the top-five utilities you feel every computer should have. For each utility, discuss whether it is included in the OS and/or if there are alternatives that can be downloaded for free or that can be purchased as stand-alone progra..

  What are the similarities between risc and cisc

What are the similarities between RISC and CISC

  How many pages does a process have

A machine has a 32 bit virtual address space and a 16kb page size. It has 1gb of physical memory. How many pages does a process have? How many bytes are needed for a page table, assuming 4 control bits and that disk addresses are stored elsewhere?

  Explaining organization management responsibilities

Describe in scholarly detail common organization management responsibilities.

  Initial stage of software leading to its growth

My paper will focus of the initial stage of software leading to its growth and how it's used now. I also will focus on ideas of the direction Software Engineering will take technology. Technology grown rapidly from the day of the first compute..

  Write a class encapsulating a course

write a class encapsulating a course. Where a course is assumed to have three attributes: a code name, a description and number of credits.

  Firms that make game systems like playstation

Firms that make game systems like Playstation and Nintendo typically charge a price close to average cost on the game system itself, and do not change that price even when the systems are scarce or demand increases. Why might this be a profit-maximiz..

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