Programming Basics – Using a Case Construct in Pseudocodes

Publicado el: 10 enero 2020
en el canal de: Let's Simplify Computers with MrigVats Learning
4,510
26

It is not always that you get to choose one out two options. Many a times you might need to choose one out of multiple options. In such a case, one option for you is to test every option and then depending on the result, you select the favorable option. For example, while driving, when you reach a cross road or a junction, you have to select a road that leads to the destination. If you do not know the exact turn and the junction does not have proper direction board, you would take a random turn, drive some distance and check with someone about the direction. If you still don’t get the correct directions, you would like repeat the same with each turn till you get the correct direction.
However, if either you have a GPS navigation system or a direction board on the junction displays your destination, then you can straight away take the desired road for your onward journey.
Similarly, on a switch board, you either test each switch on it to check the device it switches on and off or if you know the respective device connected to a switch, you can straight away use the switch.
In most of the programming languages, you can use a case construct that enables a user to select one of the available options. The naming convention or format of the case construct might differ according to the programming language, but the underlying concept remains the same. A case construct enables the user to run a specific set of instructions in a program.
A case construct has two components: Evaluation, which verifies the value of a variable and body that defines various blocks of statements that should be run based on the value of the variable.


En esta página del sitio puede ver el video en línea Programming Basics – Using a Case Construct in Pseudocodes de Duración hora minuto segunda en buena calidad , que subió el usuario Let's Simplify Computers with MrigVats Learning 10 enero 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 4,510 veces y le gustó 26 a los espectadores. Disfruta viendo!