Advertisement
jadestorm23

Untitled

Mar 7th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.48 KB | None | 0 0
  1. //Hunter Basinger 3/7/2017
  2. #include <iostream>
  3. #include <cstdlib>
  4. #include <windows.h>
  5. using namespace std;
  6. #include <time.h>
  7.    
  8. void intro()
  9.     {
  10.         setFontSize(12);
  11.         cout<<"Welcome user to rectangle creator." << endl;
  12.         cout<<"This is will create a rectangle based on the length and sides you choose." << endl;
  13.         cout<<"But firstly you need to learn what a retangle is, so when you're ready press enter for an explanation. " << endl;
  14.         cin.ignore();  
  15.        
  16.         ClearScreen();
  17.        
  18.         cout<<"A rectangle is a shape that has a diffrent side and length. It's much like a square except it's not. " << endl;
  19.         cout<<"It still has four 90 degree angles like a square, but it's not equal on all sides. " << endl;
  20.         cout<<"When you're ready to create the rectangle hit enter." << endl;
  21.         cin.ignore();
  22.        
  23.         ClearScreen();
  24.     }
  25.  
  26. int main()
  27. {
  28.     TextandBackgroundColors(1, 14);
  29.     intro();
  30.    
  31.     string answer;
  32.     char Mark = '*';
  33.     int Length;
  34.     int width;
  35.     do
  36.     {
  37.         setFontSize(12);
  38.     cout<<"Please enter the length: ";
  39.     cin>> Length;
  40.    
  41.     cout<<"Please enter your width: ";
  42.     cin>> width;
  43.    
  44.     ClearScreen();
  45.    
  46.     cout<<"Creating rectangle...";
  47.    
  48.     Sleep(2500);
  49.     ClearScreen();
  50.    
  51.     cin.ignore();
  52.    
  53.    
  54.     for(int x = 0; x != width; x++)
  55.     {
  56.        
  57.         setFontSize(20);
  58.         for(int i=0; i < Length; i++)
  59.         {
  60.            
  61.             cout<<Mark;
  62.         }
  63.         cout<<endl;
  64.     }
  65.  
  66.    
  67.     cout<<"Would you like to create another rectangle?: ";
  68.     cin >>  answer;
  69.     ClearScreen();
  70.    
  71.     }while(answer != "Yes" || answer != "yes");
  72.     return 0;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement