Rectanglewithborderm n that displays a block of characters


Question: Write the following R functions. Use nested loops in your solution.

1. rectangleWithBorder(m, n) that displays a block of characters that is m rows by n columns in dimension. The squares on the border of the block should be zeros. All interior squares should be x's. For example, if the user enters 5 for the number of rows and 9 for the number of columns, your function should output the pattern shown below.

000000000
0XXXXXXX0
0XXXXXXX0
0XXXXXXX0
000000000

2. rightTriangle(base) that prints a right triangle of zeros with a vertical right side and a base of base zeros. For example, if the user enters 5 for the base, the function should output the pattern shown below.

0
00
000
0000
00000

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Rectanglewithborderm n that displays a block of characters
Reference No:- TGS02263736

Expected delivery within 24 Hours