Guest User

Untitled

a guest
Jun 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. /*
  2. Programmer: swazeyyy:
  3. Date: 2/11/12
  4. */
  5.  
  6. #include <iostream>
  7. #include <string>
  8.  
  9. using std::cout;
  10. using std::cin;
  11. using std::endl;
  12.  
  13. // Function declaration
  14. int AreaCalc(int,int);
  15.  
  16. // Variable declaration
  17. int length = 0;
  18. int width  = 0;
  19. int area   = 0;
  20.  
  21.  
  22. // Main function
  23. int main()
  24. {
  25.     cout << " #---------------------# " << endl;
  26.     cout << " *                     * " << endl;
  27.     cout << " *   Area Calculator   * " << endl;
  28.     cout << " *                     * " << endl;
  29.     cout << " #---------------------# " << endl;
  30.     system("pause"); // Note: Required Windows
  31.  
  32.     cout << " *                     * " << endl;
  33.     cout << " * Enter the length:";
  34.  
  35.     cin >> length;
  36.  
  37.     cout << " * Enter the width:";
  38.  
  39.     cin >> width;
  40.  
  41.     area = AreaCalc(length,width);
  42.  
  43.     cout << " *  Total Area: " << area << "      *" << endl;
  44.     cout << " *                     * " << endl;
  45.     cout << " #---------------------# " << endl;
  46.     system("pause"); // Note: Required Windows
  47.  
  48.     return 0;
  49. }
  50.  
  51. // Function definition
  52. int AreaCalc(int a, int b)
  53. {
  54.     int c;
  55.     c=a*b;
  56.     return c;
  57. }
Add Comment
Please, Sign In to add comment