Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is done in matlab. PART I: Nested Loops - The first 6 problems should all run in succession. Put them in one script. 1)
this is done in matlab.
PART I: Nested Loops - The first 6 problems should all run in succession. Put them in one script. 1) Print a rectangle. Read a height and width and print a rectangle with that height and width. This example output has height 3 and width 7. 2) Print a triangle. Read a number and print a triangle of that size. This example is of size 6. 3) Print another triangle. Read a number and print a triangle of that size. This is a little different than the problem above because you'll have to print some spaces at the beginning of each line. This example is of size 6. 4) Print a rectangle outline. Read a height and width and print a rectangle that looks like the one below. This example has a height of 5 and width of 7. You might choose one of two approaches to this problem. 1. Break it down into three problems a line of stars, lines consisting of a star, blanks, and a star, and again a line of stars, or 2. At each position write either a star or blank. Use an statement to test for first or last row of first or last column, in which case a star is printed, otherwise print a blank 5) Print a pyramid. Read a number, n, and print a pyramid that has that size. The example below shows what would be printed for 4 6) Print a parallelogram. Again read n in a loop. For each value of produce output that makes a parallelogram like the following for n-6. You might find it easier to solve this by breaking the problem into two simpler problems: eg. thinking of this as an upper triangle and a lower tangle 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