COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the variable name in this Pseudocode?STARTSEND ‘Whats your name?’ TO DISPLAYRECEIVE agE FROM KEYBOARD (INT)
A
age
B
Age
C
AGE
D
agE
Explanation: 

Detailed explanation-1: -Variable Declaration In pseudocode, it is very easy to declare variables! We just need to mention the variable name then assign a value to it. For example, if we were making a calculator app, we would make a variable called number. We could then use this later to perform our calculations, which we will get into later!

Detailed explanation-2: -Variable Assignments Assigning a value to a variable is indicated in pseudocode using an arrow symbol (←). The arrow points from the value being assigned towards the variable it is being assigned to. The following line of pseudocode should be read as ‘a becomes equal to 34’.

Detailed explanation-3: -A variable is declared the first time a value is assigned. It assumes the data type of the value it is given. Variables declared inside a function or procedure are local to that subroutine. print("Hello") next i Will print hello 8 times (0-7 inclusive).

Detailed explanation-4: -We can use the INPUT() expression in pseudocode to get input from the user. It works just like a procedure, similar to DISPLAY(), but it doesn’t require any parameters.

There is 1 question to complete.