user input and program design
Hey everyone,
I was writing some pseudocode to a very basic program and I was just wondering about something in my design, this is all in pseudocode (obviously :p ):
Code:
int main()
{
Prompt for amt_requested
Get amt_requested
IF (amt_requested != 0) AND ( amt_requested <= 1000)
Prompt for interest_rate, loan_duration
Get interest_rate, loan_duration
ENDIF
WHILE (amt_requested != 0 ) AND (amt_requested <= 1000)
loop body
ENDWHILE
}
What I was trying to accomplish is I want to run the loop until a sentinel (is that the right word?) value is entered (in this case 0 or anything over 1000), and I wanted to make sure that if a user enters a 0, they dont have to trudge through entering 2 more values for the other variables if they will never be used, so I wrote an if statement that does an initial check on the first value entered,now I was wondering if this is sloppy, or cumbersome, or redundant, anything like that. Thanks yet again for the help! -Chap