Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 c++ flowchart

views
     
TSpw8799
post Oct 28 2016, 01:10 PM, updated 8y ago

On my way
****
Senior Member
680 posts

Joined: Mar 2014
#include <iostream>

using namespace std;

int main()
{
float a11, a12, a13, a21, a22, a23, a31, a32, a33, d1, d2, d3;

cout << "ENTER THE VALUE FOR THE EQUATIONS" << endl;
cout << "Enter the value of a11, a12, a13 and d1" << endl;
cin >> a11 >> a12 >> a13 >> d1;

cout << "Enter the value of a21, a22, a23 and d2" << endl;
cin >> a21 >> a22 >> a23 >> d2;

cout << "Enter the value of a31, a32, a33 and d3" << endl;
cin >> a31 >> a32 >> a33 >> d3;
// INPUT SECTION //
// PROCESS SECTION //

double f1=(a21/a11)*a11, f2=(a21/a11)*a12, f3=(a21/a11)*a13, f4=(a21/a11)*d1;

cout << f1 << "x+" << f2 << "y+" << f3 << "z=" << f4 << endl;
cout << a21 << "x+" << a22 << "y+" << a23 << "z=" << d2 << endl;
cout << f1-a21 << "x+" << f2-a22 << "y+" << f3-a23 << "z=" << f4-d2 << "\n" << endl;

double f5=(a31/a11)*a11, f6=(a31/a11)*a12, f7=(a31/a11)*a13, f8=(a31/a11)*d1;

cout << f5 << "x+" << f6 << "y+" << f7 << "z+" << f8 << endl;
cout << a31 << "x+" << a32 << "y+" << a33 << "z=" << d3 << endl;
cout << f5-a31 << "x+" << f6-a32 << "y+" << f7-a33 << "z=" << f8-d3 << "\n" << endl;

double f9=(f1-a21)*((f6-a22)/(f2-a22)), f10=(f2-a22)*((f6-a32)/(f2-a22));
double f11=(f3-a23)*((f6-a32)/(f2-a22)), f12=(f4-d2)*((f6-a32)/(f2-a22));

cout << f9 << "x+" << f10 << "y+" << f11 << "z=" << f12 << endl;
cout << f5-a31 << "x+" << f6-a32 << "y+" << f11-(f7-a33) << "z=" << f12-(f8-d3) << endl;
cout << "z=" << (f12-(f8-d3))/(f11-(f7-a33)) << "\n" << endl;

double z=(f12-(f8-d3))/(f11-(f7-a33));

cout << f5-a31 << "x+" << f6-a32 << "y+" << (f7-a33)*z << "=" << f8-d3 << endl;
cout << f5-a31 << "x+" << f6-a32 << "y+" << (f8-d3)-((f7-a33)*z) << endl;
cout << f5-a31 << "x+" << "y+" << "=" << ((f8-d3)-((f7-a33)*z))/(f6-a32) << endl;
cout << "y+" << ((f8-d3)-((f7-a33)*z))/(f6-a32) << "\n" << endl;

double y=((f8-d3)-((f7-a33)*z))/(f6-a32);

cout << a11 << "x+" << a12*y << "+" << a13*z << "=" << d1 << endl;
cout << a11 << "x+" << (d1-a12*y-a13*z) << endl;
cout << "x+" << (d1-a12*y-a13*z)/a11 << "\n" << endl;

system("pause");
return 0 ;

}

I'm asked to do a flowchart for the progarmming code above ....
Since the working can be printed on screen ( teh progammer use cout<< )

So , should i group the working as result or process ?


Attached thumbnail(s)
Attached Image
WongGei
post Oct 28 2016, 02:46 PM

Regular
******
Senior Member
1,206 posts

Joined: Dec 2007
From: Kuala Lumpur
https://en.wikipedia.org/wiki/Flowchart

A flowchart is a type of diagram that uses an algorithm, workflow or process, showing the steps as boxes of various kinds, and their order by connecting them with arrows......


zeb kew
post Oct 31 2016, 02:11 PM

Look at all my stars!!
*******
Senior Member
2,325 posts

Joined: Sep 2015
pw8799 is confused by the fact that the code shows the workings of the calculations as well as the results. That the workings are shown do not turn them into results. The results are the results, and the workings are processes.

If TS is a human and not an AI, it should be obvious that which is the result, and which is the working. smile.gif
sundaemanis
post Oct 31 2016, 09:52 PM

New Member
*
Junior Member
48 posts

Joined: Mar 2012



You should define what is your program problem and solution here. People won't bother to read your code and write a flowchart to you.

or at least tell your input, process and output.
dstl1128
post Nov 2 2016, 02:16 PM

Look at all my stars!!
*******
Senior Member
4,463 posts

Joined: Jan 2003
Run cflow over your code?

 

Change to:
| Lo-Fi Version
0.0142sec    0.80    6 queries    GZIP Disabled
Time is now: 29th March 2024 - 03:43 PM