137. In mathematics, a perfect number is a type of integer. The procedure IsPerfect (num) returns true if num is a perfect number and returns false otherwise. The following program is intended to count and display the number of perfect numbers between the integers start and end, inclusive. Assume that start is less than end. The program does not work as intended. Line 1: currentNum + start Line 2: count e0 Line 3: REPEAT UNTIL (currentNum > end) Line 4: Line 5: count + count + 1 Line 6: IF (IsPerfect (currentNum)) Line 7: Line 8: count + count + 1 Line 9: currentNum e currentNum + 1 Line 10: Line 11: currentNum + currentNum Line 12: Line 13: DISPLAY (count) Which two lines of code should be removed so that the program will work as intended? Select two answers. (A) Line 5 (B) Line 8 (C) Line 9 (D) Line 11
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.


Trending now
This is a popular solution!
Step by step
Solved in 2 steps









