variable number and value. 0 to exit menu. n ); op= 1 raquo ;; (op!= 0 )
{(% c raquo ;, amp; op); (op)
{ 1 :
{(% lf raquo ;, amp; t_begin); ( OK n ) ;;
} 2 :
{(% lf raquo ;, amp; t_end); ( OK n ) ;;
} 3 :
{(% lf raquo ;, amp; t_1); ( OK n ) ;;
} 4 :
{(% lf raquo ;, amp; a); ( OK n ) ;;
} 5 :
{(% lf raquo ;, amp; b); ( OK n ) ;;
} 6 :
{(% lf raquo ;, amp; c); ( OK n ) ;;
} 7 :
{(% lf raquo ;, amp; U1); ( OK n ) ;;
} 8 :
{(% lf raquo ;, amp; U2); ( OK n ) ;;
}:
//printf ( Unrecognised ) ;;
}
}
} _ tmain (int argc, _TCHAR * argv [])
{op; (true)
{( n nEnter charachter: n n1) Form arrays n2) Determine fronts n3) arrays to files n4) Read data from file n5) Input variables n6 ) Write data to file n7) Display data n8) Exit n n ); (% c raquo ;, amp; op); (op)
{ 1 :
{_ time (); _ Uvx (); _ Uvix (); _ data () ;;
} 2 :
{( Uvx: n ); (Uvx, LEFT); (Uvx, RIGHT); ( nUvix: n ); (Uvix, LEFT); (Uvix , RIGHT) ;;
} 3 :
{_ arrays (); ( nDone. n ) ;;
} 4 :
{_ data (); ( nDone. n ) ;;
} 5 :
{_ data () ;;
} 6 :
{_ data (); ( nDone. n ) ;;
} 7 :
{_ data () ;;
} 8 :
{(0) ;;
}:
{( nUnrecognised command n ) ;;
}
}
} 0;
}
Calc.cpp
# include mainheader.h form_time ()
{= (t_end - t_begin)/double (N - 1); (int i=0; i lt; N; i ++)//Формування масиву часу t
{[i]=t_begin + i * timedelta;
}
} form_Uvx ()
{(int i=0; i lt; N; i ++)//Формування масиву Uvx
{(time [i] lt;=t_1)
{[i]=a * (1.0 - exp (-b * time [i]));
}
{[i]=a * (1.0 - exp (-b * time [i])) * exp (-c * (time [i] - t_1));
}
}
} form_Uvix ()
{(int i=0; i lt; N; i ++)//Формування масиву Uvix
{(Uvx [i] lt; U1)
{[i]=U2/U1 * Uvx [i];
}
{[i]=U2;
}
}
} getfront (double arr [N], frontside side)
{front=NOFRONT; frontlength=0;// довжина в кроках first=0, second=0;// індекси елементів для визначення типу
фронтаUmax, Umin, UH, UL; (side == LEFT)
{= 0; second=1;
} if (side == RIGHT)
{= N - 2; second=N - 1;
} (arr [first] lt; arr [second])
{= INCREASING;
} if (arr [first] gt; arr [second])
{= DECREASING;
} (side == LEFT)
{(int i=1; i lt; N; i ++)
{((front == INCREASING amp; amp; arr [i - 1] lt; arr [i]) || (front == amp; amp; arr [i - 1] gt; arr [i]))
{++;
}
{;
}
}
} (side == RIGHT)
{(int i=N - 1; i gt; 0; i -)
{((front == INCREASING amp; amp; arr [i - 1] lt; arr [i]) || (front == amp; amp; arr [i - 1] gt; arr [i]))
{++;
}
{;
}
}
} (side == LEFT)
{(front == INCREASING) {Umin=arr [0]; Umax=arr [frontlength]; } if (front == DECREASING) {Umin=arr [frontlength]; Umax=arr [0];