Layout Design Matrix Calculator

Hi guys, I want to ask on how to put a layout design in the program when it is being ran. It should look like these: http://i1102.photobucket.com/albums/g460/Dinadan_Caerleon/Calculator.jpeg

This is a sample code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
 
#include<iostream>
 
using namespace std;

main()
{
   int m, n, c, d, first[10][10], second[10][10], sum[10][10],
	   minus[10][10], times[10][10];
   char ans;

	
   cout << "\n\t\t\tWelcome! :)\n";
   cout << "\n\tThis is a Matrix Operation Program\n";
   cout	<< endl;
 
   cout << "\n\nEnter the number of rows and columns of matrix: \n";
   cout << "[Number of Rows]: ";
   cin >> m;
   cout << "[Number of Columns]: ";
   cin >> n;
   cout << endl;

   cout << "Enter the elements of first matrix: \n";
   cout << endl;
 
   for (  c = 0 ; c < m ; c++ )
      for ( d = 0 ; d < n ; d++ )
         cin >> first[c][d];
		cout << endl;
 
   cout << "Enter the elements of second matrix: \n";
   cout << endl;
 
   for ( c = 0 ; c < m ;c++ )
      for ( d = 0 ; d < n ; d++ )
            cin >> second[c][d];
	  cout << endl;
 
   for ( c = 0 ; c < m ; c++ )
      for ( d = 0 ; d < n ; d++ )
         sum[c][d] = first[c][d] + second[c][d];
 
   cout << "Sum of entered matrices: \n";
   cout << endl;
 
   for ( c = 0 ; c < m ; c++ )
   {
      for ( d = 0 ; d < n ; d++ )
         cout << sum[c][d] << "\t";
 
      cout << endl;
   }

 
   for ( c = 0 ; c < m ; c++ )
      for ( d = 0 ; d < n ; d++ )
         minus[c][d] = first[c][d] - second[c][d];
 
   cout << "Difference of Entered Matrices: \n";
   cout << endl;
 
   for ( c = 0 ; c < m ; c++ )
   {
      for ( d = 0 ; d < n ; d++ )
         cout << minus[c][d] << "\t";
 
      cout << endl;
   }
 

    for ( c = 0 ; c < m ; c++ )
      for ( d = 0 ; d < n ; d++ )
         times[c][d] = first[c][d] * second[c][d];
 
   cout << "Products of Entered Matrices: \n";
   cout << endl;
 
   for ( c = 0 ; c < m ; c++ )
   {
      for ( d = 0 ; d < n ; d++ )
         cout << times[c][d] << "\t";
      cout << endl;
   }

   cout << "\nDo you want to solve another matrix?\n";
   cout << "[Y] or [N]: ";
   cin  >> ans;
   cout << endl;
 

   if (ans== 'Y')

	   return main ();
  

   else (ans == 'N');

	   return 0;

}
up
for such a design you need GUI (wxwidgets, qt, etc) but not the console.
Topic archived. No new replies allowed.