Answer:
See explanation
Explanation:
Given
if(fish > 400) {
Required
What is the condition checking?
The above statement is an if conditional statement. Analysing the statement in bits:
if -> This represents the beginning of the conditional statement
fish -.> The variable that is being checked
> 400 -> The condition which the variable is being measured by.
So, the statement above is checking if the value of variable fish is greater than 400.
<em>If the condition is true, the instructions associated to that if statement will be executed.</em>
Answer:
The program is given below with appropriate comments for better understanding
Explanation:
1) LMC Program:
LDA A //Load A
SUB B //Subtract from A, B which is 0.
SKZ // skip next statement if A-B == 0 , which is A == 0 as B is zero.
JMP ENDIF // jump to ENDIF point if A not equal to 0, else this step is skipped.
OUT // some statement , not called if A != 0.
ENDIF LDA A // jump statement arrives here if A != 0.
HLT //HALT
2) LMC Program:
//input first number
INP
//store it at address 99
STA 99
//input second number
INP
//add it to value at 99
ADD 99
//store the resulting sum to 99
STA 99
//input third number
INP
//add the number to value at 99 address(which is the sum of first and second number)
ADD 99
//output sum
OUT
//halt
HLT
PDF stands for "portable document format"
Answer:
d. fullName="Harris, Ray"
Explanation:
// here we define two variables firstName="Ray" and lastName= "Harris"
var firstName = "Ray", lastName = "Harris";
// then we create another variable fullName and assign it the value stored in variabl lastName that is "Harris"
var fullName = lastName;
// then we added a coma and space. At this point fullName= Harris,
fullName += ", ";
// then we added firstName to the variable fullName. At this point fullName=Harris, Roy
fullName += firstName;
Note: the += operator means that add the variable on the left by an amount on the right
a+= b; or a = a + b; both mean same