Write a program that will prompt the user to input the following: length and width of a rectangle , a character, and a choice for either filled or unfilled.
If the choice is filled, print out a filled rectangle with the indicated length and width using the input character. If the choice is unfilled, print out an unfilled rectangle using the input character.
for example:
Length = 10 character ‘+’
Width = 6 unfilled
++++++++++
+ +
+ +
+ +
+ +
++++++++++
Well it's not posting this rectangle above me right, but there is supposed to be a blank space between the plus signs on the left and right.
----------------------------------------------------------------------------------------------------
Length = 8 character ‘Y’
Width = 3 filled
YYYYYYYY
YYYYYYYY
YYYYYYYY
here's my source code so far. I got it to enter the length width, and character. But getting it to make a rectangle is a whole another story. And how should I prompt it for fill or unfilled, should I declare them? And how do i get it to fill, you don't have to give me the answer just somehow point me in the right direction. Thank you for any help.
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double length, width;
char sign;
cout << "This program will create a rectangle made up of characters chosen by the user" << endl;
cout << "=============================================================================";
cout << endl << endl;
cout << "Please enter the length of the rectangle";
cin >> length;
cout << endl;
cout << "Please enther the width of the rectangle";
cin >> width;
cout << endl;
cout << "Please enter a character of your choice";
cin >> sign;
cout << endl;
cout << "You enter the length of:\n\n" << length << endl << endl;
cout << "You entered the width of :\n\n" << width << endl << endl;
system("pause");
}