5. 122 pointsl the following information about computer program Given here is an
ID: 3801731 • Letter: 5
Question
Explanation / Answer
(a) it says that in your program, in the first five lines -
i. there is either a missing variable.
ii. or syntax error - it further says that if their is a syntax error - 1. there is a mispelled variable or 2. a semicolon is present.
it further says that 1. and 2. are not present.
therefore, for their to be an error after this, then condition i. must hold!
so e. will be - there is an undeclared variable!
-------------------------
(b)
let P = there is an undeclared variable.
let Q = there is a syntax error
then P OR Q = True (given from first line)
but Q = X OR Y where X = there is a mispelled variable Y = a semicolon is present.
given, X = false Y = false
therefore, Q = false
but we know P OR Q = True
hence P must be True
but P = there is an undeclared variable.
therfore line e is there is an undeclared variable.
--------------------------------------
(c)
i have already given the true false values in (b) for the true case, construct for the other cases accordingly.
-------------------------------------
thank you
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.