The common name for a process, which occurs when the programmer finds and correc
ID: 3731907 • Letter: T
Question
The common name for a process, which occurs when the programmer finds and corrects the code that is causing the error(s) is Your answer In programming, a set of well-defined logical steps that must be taken to perform a task is known as a(n) Your answer 1: Display "Enter 3 numbers please: " 2: Input num1 3: Input num2 4: Input num3 5: Set total = num1 + num2 6: Display "The total is: " 7: Display total The code above is intended to add 3 numbers and display the sum, but it has a logic error. Which line should be changed and what should it be changed to so that it works correctly? Enter the line number followed by a colon, space, and the new code. Your answerExplanation / Answer
Please find the questions below : -
Question 1 : The Common name for a process which occurs when the programmer finds and corrects the code that is causing the error(s) is "debugging"
Question 2 : In programing a set of logical steps that must be taken to perform a task is known as a(n) "Program"
Question 3 :
1: Display “Enter 3 numbers please: “
2: Input num1
3: Input num2
4: Input num3
5. Set total = num1 + num2
6: Display “The total is:”
7. Display total
The code above is intended to add 3 numbers and display the sum, but it has a logic error. Which line should be changed and what should it be changed to so that it works correctly? Enter the line number followed by a colon, space, and the new code
Answer : Line number 5 needs to be changed. Right now it adds only two numbers, i.e., num1 and num2. we need to add num3 as well. Following would be the new code
5: Set total = num1 + num2 + num3
Question 4 : In many programming languages, _ variables hold unpredictable values, but in other languages, a default value is assigned to such variables.
Answer : Instance variables which are not assigned to any value during the object creation can have unpredictable values in few languages and other language by default sets a default value.
Question 5 :
Set A = 15
Set B = 25
Set A = 10
Display A
What would be displayed by the code above ?
Answer : 10
Explanation : We can see that the variable A is set value 15 in the first line and then again re-assigned a new value "10" in the 3rd line. As computer scans and executes a program step by step starting at the first line of the program, third line (i.e., Set A = 10) of the above program would change A's previous value (15) to new value (10). Hence the "Display A" statement would return A's latest value i.e., 10.
Question 6 :
(x > 5) OR (NOT flag)
If x == 5 and flag = true, what does the expression above evaluate to ?
Answer : false
Explanation : the above expression can be writted by replacing x by 5 as below :
(5 > 5 ) OR ( NOT true)
Since 5 is not greater that 5, then 5 > 5 = false
and NOT true (NOT of true) is again false
Hence the final expression conversion is like -
(x > 5) OR (NOT flag) = (5 > 5 ) OR (NOT true) = false or false = false
Question 7 : A _ variable is declared inside a module and cannot be accessed by statements that are outside the module
Answer : private
Question 8 : A _ constant is a named constant that is available to every module in the program
Answer : global
Explanation : Globally defined constants are accessible to the whole program (i.e., to every module)