Загрузка данных
<mxfile host="app.diagrams.net">
<diagram name="Lab7-1" id="lab7-1-flowchart">
<mxGraphModel dx="1200" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- ==================== MAIN ==================== -->
<mxCell id="m_start" value="начало" style="rounded=1;whiteSpace=wrap;html=1;arcSize=50;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="140" y="40" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="m_in" value="вв. k" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="140" y="110" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="m_cond_k" value="k < 1" style="rhombus;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="145" y="180" width="130" height="60" as="geometry" />
</mxCell>
<mxCell id="m_err" value="выв. 'Ошибка: k >= 1'" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="310" y="187.5" width="160" height="45" as="geometry" />
</mxCell>
<mxCell id="m_call" value="P := calculateProduct(k)" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="115" y="280" width="190" height="45" as="geometry" />
</mxCell>
<mxCell id="m_out" value="выв. P" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="140" y="360" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="m_end" value="конец" style="rounded=1;whiteSpace=wrap;html=1;arcSize=50;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="140" y="435" width="140" height="40" as="geometry" />
</mxCell>
<!-- СВЯЗИ MAIN -->
<mxCell id="me1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="m_start" target="m_in">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="me2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="m_in" target="m_cond_k">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="me3" value="да" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="m_cond_k" target="m_err">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="me4" value="нет" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="m_cond_k" target="m_call">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="me5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="m_call" target="m_out">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="me6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="m_out" target="m_end">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="me7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=1;entryY=0.5;" edge="1" parent="1" source="m_err" target="m_end">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="390" y="455" />
</Array>
</mxGeometry>
</mxCell>
<!-- ==================== ФУНКЦИЯ calculateProduct ==================== -->
<mxCell id="f_start" value="нач. ф calculateProduct (k)" style="rounded=1;whiteSpace=wrap;html=1;arcSize=50;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="640" y="40" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="f_init" value="P := 1" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="670" y="110" width="140" height="40" as="geometry" />
</mxCell>
<!-- БЛОК МОДИФИКАЦИИ (ЦИКЛ FOR) -->
<mxCell id="f_loop" value="m := 1, k + 2" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="660" y="180" width="160" height="50" as="geometry" />
</mxCell>
<mxCell id="f_cond_m2" value="m = 2" style="rhombus;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="675" y="260" width="130" height="55" as="geometry" />
</mxCell>
<mxCell id="f_cond_m4" value="m = 4" style="rhombus;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="675" y="345" width="130" height="55" as="geometry" />
</mxCell>
<mxCell id="f_calc" value="factor := (m³ - 8) / (m - 4)
P := P · factor" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="645" y="435" width="190" height="55" as="geometry" />
</mxCell>
<mxCell id="f_ret" value="возврат P" style="rounded=1;whiteSpace=wrap;html=1;arcSize=50;strokeWidth=1.5;" vertex="1" parent="1">
<mxGeometry x="930" y="185" width="130" height="40" as="geometry" />
</mxCell>
<!-- СВЯЗИ ВНУТРИ ФУНКЦИИ -->
<mxCell id="fe1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="f_start" target="f_init">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fe2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="f_init" target="f_loop">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- Вход в тело цикла -->
<mxCell id="fe3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="f_loop" target="f_cond_m2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- m = 2 : нет -->
<mxCell id="fe4" value="нет" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="f_cond_m2" target="f_cond_m4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- m = 4 : нет -->
<mxCell id="fe5" value="нет" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="f_cond_m4" target="f_calc">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- Возврат из вычисления на следующую итерацию цикла -->
<mxCell id="fe6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="f_calc" target="f_loop">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="580" y="462" />
<mxPoint x="580" y="205" />
</Array>
</mxGeometry>
</mxCell>
<!-- m = 2 (да): пропуск шага, возврат в цикл -->
<mxCell id="fe7" value="да" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="f_cond_m2" target="f_loop">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="605" y="287" />
<mxPoint x="605" y="205" />
</Array>
</mxGeometry>
</mxCell>
<!-- m = 4 (да): пропуск шага, возврат в цикл -->
<mxCell id="fe8" value="да" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="f_cond_m4" target="f_loop">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="595" y="372" />
<mxPoint x="595" y="205" />
</Array>
</mxGeometry>
</mxCell>
<!-- Выход из цикла for направо -->
<mxCell id="fe9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="f_loop" target="f_ret">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>