Programming Basics – Using a Case Construct in Pseudocodes

Publicado em: 10 Janeiro 2020
no 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.


Nesta página do site você pode assistir ao vídeo on-line Programming Basics – Using a Case Construct in Pseudocodes duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Let's Simplify Computers with MrigVats Learning 10 Janeiro 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 4,510 vezes e gostou 26 espectadores. Boa visualização!