Programming Basics – Using a Case Construct in Pseudocodes

Publié le: 10 janvier 2020
sur la chaîne: 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.


Sur cette page du site, vous pouvez voir la vidéo en ligne Programming Basics – Using a Case Construct in Pseudocodes durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Let's Simplify Computers with MrigVats Learning 10 janvier 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 4,510 fois et il a aimé 26 téléspectateurs. Bon visionnage!