Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Hunter Basinger 3/7/2017
- #include <iostream>
- #include <cstdlib>
- #include <windows.h>
- using namespace std;
- #include <time.h>
- void intro()
- {
- setFontSize(12);
- cout<<"Welcome user to rectangle creator." << endl;
- cout<<"This is will create a rectangle based on the length and sides you choose." << endl;
- cout<<"But firstly you need to learn what a retangle is, so when you're ready press enter for an explanation. " << endl;
- cin.ignore();
- ClearScreen();
- cout<<"A rectangle is a shape that has a diffrent side and length. It's much like a square except it's not. " << endl;
- cout<<"It still has four 90 degree angles like a square, but it's not equal on all sides. " << endl;
- cout<<"When you're ready to create the rectangle hit enter." << endl;
- cin.ignore();
- ClearScreen();
- }
- int main()
- {
- TextandBackgroundColors(1, 14);
- intro();
- string answer;
- char Mark = '*';
- int Length;
- int width;
- do
- {
- setFontSize(12);
- cout<<"Please enter the length: ";
- cin>> Length;
- cout<<"Please enter your width: ";
- cin>> width;
- ClearScreen();
- cout<<"Creating rectangle...";
- Sleep(2500);
- ClearScreen();
- cin.ignore();
- for(int x = 0; x != width; x++)
- {
- setFontSize(20);
- for(int i=0; i < Length; i++)
- {
- cout<<Mark;
- }
- cout<<endl;
- }
- cout<<"Would you like to create another rectangle?: ";
- cin >> answer;
- ClearScreen();
- }while(answer != "Yes" || answer != "yes");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement