Question
In this part of the homework, we will have a number of different outputs. Each output is a simple modification of the previous one. So,
In this part of the homework, we will have a number of different outputs. Each output is a simple modification of the previous one. So, please complete them in sequence. Then, think about how to modify the solution from the previous step to solve the next part. Feel free to cut and paste your code from one part to the next and modify.If you cannot complete the whole problem, you will get partial credit for all the parts you completed. The aim is to teach you how to solve problems in an iterative way, test your solution and then add more complexity.
You must not use any IF or FOR statements or loops in your program. We have not learned them yet, they are not needed, and they will not make your solution better or more elegant.
Write a simple program that reads a word and two integers. The word will be used in the optional challenge (d) grid. The integers refer to the number of columns and rows in a grid, respectively. Then your program should print increasingly complex grids as explained below. You can find a sample run of the program at the end of this homework statement.
You may assume that the values entered for column and row are odd numbers. You may also assume that the number of columns is at least 3 and that the number of rows is at least 5. This will simplify the program logic.
(a.) Print the word you just entered (Your word is:) and then a grid of three stars *** given by the number of columns and rows. The columns are separated by a single space. There are no spaces at the end of the line.
Here is a simple run of this program (how it will look when you run it using Wing IDE):
Word => Hello Hello #columns => 5 5
#rows => 7 7 Your word is: Hello
(a) *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Note : (That weird space is just the result of a copy and paste page break. I can't delete it)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started