Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program Lab;
- Var
- Radius, Side: Integer;
- IsCorrect: Boolean;
- Begin
- Writeln('The program will determine whether the circle fits into the square.');
- Write('Enter radius: ');
- Repeat
- Try
- IsCorrect := True;
- Read(Radius);
- If (Radius < 0) Or (Radius = 0) Then
- Begin
- IsCorrect := False;
- Write('A negative value or zero was entered. Enter a valid value: ');
- End;
- Except
- Begin
- Write('Symbols have been entered. Enter the number: ');
- IsCorrect := False;
- End;
- End;
- Until IsCorrect;
- Write('Enter side: ');
- Repeat
- Try
- IsCorrect := True;
- Read(Side);
- If (Side < 0) Or (Side = 0) Then
- Begin
- IsCorrect := False;
- Write('A negative value or zero was entered. Enter a valid value: ');
- End;
- Except
- Begin
- Write('Symbols have been entered. Enter the number: ');
- IsCorrect := False;
- End;
- End;
- Until IsCorrect;
- If (Radius * 2) < Side Then
- Writeln('Fit in.')
- Else
- Writeln('Not fit in.');
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement