Question: Exercise 2: Write a program that reads the length, L, and width, W, of a rectangle from the user and prints a rectangle of stars
Exercise 2: Write a program that reads the length, L, and width, W, of a rectangle from the user and prints a rectangle of stars followed by a triangle of stars (see the sample below). The rectangle should have W lines of stars where each line has L stars. The base of the triangle has L stars You must write and use the following functions: a) b) voidgetLenWid(int&, ints) :reads the length, L, and width, W, from the user. voidprintRectangle (int, stars int) : prints a rectangle of stars. The number of lines is W and each line contains L c) voidprintTriangle (int) : prints a triangle of stars. The triangle base hasl stars. Note: Do not use any global variables and use reference parameters only where appropriate Enter length and width: 53 RH
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
