Decision-making statements

Primary Response: Within the Discussion Board area, write 200–250 words that respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your classmates. Be substantive and clear, and use examples to reinforce your ideas.

For this Discussion Board, please complete the following:

Decision-making statements are used to control the flow of the program. For example, you may use a decision-making statement to write a program to determine if a student passes the class based on his or her score. If the score is equal to or greater than 60, the student passes the class. Otherwise, the student fails. Assume that you are the programmer hired by a bank to write a program for its automated teller machines (ATM). Give an example that makes use of a decision-making statement in the program, and answer the following questions:

Which decision-making statement will you use, (e.g., if, if-else, or switch) for that example?

Why do you use that decision-making statement for that example?

 ORDER THIS PAPER NOW

Discussion board 3

Which decision-making statement will you use, (e.g., if, if-else, or switch) for that example?

I am going to utilize a switch statement. The switch statement is advantageous for your programming ambitions in a number of ways. One of the switch statement’s primary merits is its readability, which is considered to be rather easy (Philip, 2019). This simplifies coding since you can know where it is heading just by looking at it. The ease with which it may be read also makes it easy to grasp its maintenance. As a programmer, you’ll discover that debugging the switch statement is straightforward. The focus is on error identification and correction.

Why do you use that decision-making statement for that example?

Decision-making in programming is comparable to decision-making in real life. We often encounter situations in programming where we want a piece of code to be executed only when a certain condition is fulfilled (Kasten et al., 2017). In programming languages, regulate statements are used to control the flow of a program’s execution based on specified criteria. The switch statement has several benefits for your programming endeavors. One of the primary advantages of the switch statement is its readability, which is generally regarded to be relatively simple. This simplifies the coding process, since you can easily determine its bearing. The user may compare a variable’s multiple values with a single switch statement and a number of cases.

References

Kasten. Run-Time, (2017). Composition and State Management for Adaptive Systems. In Proceedings of the 24th International Conference on Distributed Computing Systems Workshops, pp 332–337.

Philip K. McKinley, (2019) Composing Adaptive Software. In Journal Computer,volume 37, pp 56–64