### Help with flowcharts.

Hello everyone! I am having a bit of trouble in my online c++ class and I need some help drawing a flowchart for my design work. I already did the program without doing the flowchart (I haven't done one before and have no idea what to do). I could use some help creating a flowchart for this program. And are there any places where I can create flowcharts easily on the internet?

 ``1234567891011121314151617181920212223242526272829303132333435363738`` `````` using namespace std; int main () { int selection = 0; double input1(0.0); double input2(0.0); char indicator('n'); cout << "Welcome to Andrew's C++ Calculator" << endl; cout << " Please enter two integers to find the sum, difference, product, quotient, square root, and power of " << endl; for (;;) { cin >> input1; cin >> input2; cout << " The difference of " << input1 << " minus " << input2 << " is " << input1-input2 << endl; cout << " The sum of " << input1 << " plus " << input2 << " is " << input1+input2 << endl; cout << " The product of " << input1 << " times " << input2 << " is " << input1*input2 << endl; cout << " The quotient of " << input1 << " divided by " << input2 << " is " << input1/input2 << endl; cout << " The square root of " << input1 << " is " << sqrt( input1 ); cout << input2 << " to the 4th power is " << pow( input2,4 ); } }``````
Umm...Line 18 is pretty bad especially since you never even put a break/return anywhere the program will never end.. Also for( ; ; ) looks tacky I would suggest a while loop and have a code to quit (eg if the user inputs a -99 or something then quit.

As for a flow chart you will put what the program does.

like this

------------------
|Loop forever|
------------------
|
------------------------
|Get 2 user inputs|
------------------------
|
-------------------------
|Compute difference|
--------------------------
|
-------------------
|compute sum|
-------------------

.....

Yours doesn't really have any branches since you have no conditions with multiple paths.

http://office.microsoft.com/en-us/visio-help/create-a-basic-flowchart-HP001207727.aspx
http://www.edrawsoft.com/How-to-draw-flowchart.php
http://lmgtfy.com/?q=how+to+create+a+flow+chart
Ahhh okay sweet, thanks a ton. I do have another question because I have to do this for another program and I am freaking out as well. How would I go about making a chart for a program like this?

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899`` `````` using namespace std; #include #include int main (){ string first_name; string last_name; int idnum; int jobclass; int totalhours; cout << " State employee's name. ( First, Last ) " << endl; cin >> first_name; cin >> last_name; cout << " State your Id Number. " << endl; cin >> idnum; cout << " State job classification. " << endl; cin >> jobclass; cout << " Hours worked this week: " << endl; cin >> totalhours; double hourlyrate; switch (jobclass){ case 1: hourlyrate = 5.50; break; case 2: hourlyrate = 6.00; break; case 3: hourlyrate = 7.00; break; case 4: hourlyrate = 9.00; break; case 5: hourlyrate = 12.00; break; default: hourlyrate = 5.50; break; } int overtimehours, regularhours; if (totalhours > 40){ //employee worked more than regular hours overtimehours = totalhours - 40; regularhours =40; } else { //employee didn't work more than regular hours overtimehours = 0; regularhours = totalhours; } double reg_pay; double overtime_pay; reg_pay = regularhours * hourlyrate; overtime_pay = (overtimehours) * 1.5 * hourlyrate; cout << " Employee Name: " << first_name << " " << last_name << " ID. Number: " << idnum << endl; cout << " Job Classification: " << jobclass << " Hourly Rate " << hourlyrate << endl; cout << " Total Hours Worked: " << totalhours << " Overtime Hours: " << overtimehours << endl; cout << " Regular Pay: " << reg_pay << " Overtime Pay: " << overtime_pay << endl; cout << " Total Earnings ......... " << reg_pay + overtime_pay << endl; if (totalhours < 40){ cout << " Inadequit number hours worked. " << endl; } if (totalhours > 60){ cout << " Excessive number of hours worked! " << endl; } if (jobclass < 1 || jobclass > 5) { cout << " **** The Employee's Job Classification is in error **** " << endl; } } ``````
basically condition's are like this

_____________
|some condition|
---------------------
_____|_______...._________________
|If something....|---|if something else...|
---------------------...---------------------------
______|____........________|___
|do this.......|........|do something|
----------------.........-------------------
_____________|_____
|Next thing in the chart|
-------------------------------
Topic archived. No new replies allowed.