Question
5.6 - Discussion: Should Loops be Well-Disciplined, or... ...Should Programmers be able to use GO TO statements as they please? Some programming languages require that
5.6 - Discussion: Should Loops be Well-Disciplined, or...
...Should Programmers be able to use GO TO statements as they please?
Some programming languages require that a loop only have one way in, and one way out; there are no GO TO statements. Other languages (like BASIC and FORTRAN) allow for statements to have labels, or addresses, that another statement like a GO TO can explicitly transfer control.
Discussion: What do you see as the strengths and weaknesses of each of these approaches? Would you rather work in a strongly disciplined language, that only lets you exit your loops by falling out the bottom of them when their control variable or interaction conditions say Ive had enough? Do GO TO statements appeal to you?
Additionally, what special hazards might the programmer find when starting to combine IF, CASE, or other conditional logic on top of or inside of their loops?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started