FINAL
/ /
EXAM
/ /
QUESTIONS WITH CORRECT ANSWERS
/ // // //
What //is //the //difference //between //a //compiler //and //an //assembler?
STAGE //
1/
/CONTENT /
/QUESTION //- /
/CORRECT /
/ANSWERS(S)✔✔An /
/assembler /
/translate /
/assembly /
/lines /
/of /
/codes /
/like /
/add() /
/push() /
/etc /
/into /
/direct /
/elating /
/machine /
/code. /
/The /
/commands //relate //directly //to //a //specific //machine //code //usually //with //assembly //language.
,A/
/compiler /
/translates /
/high /
/level /
/language /
/program /
/into //machine //code, //and //the //code //can //work //on //different //types //of //machine //code.
EX: /
/Assembler /
/is /
/like //
a/
/one /
/to /
/one /
/translator /
/(English //- //> //Spanish) //while //a //compiler //can //translate //to //multiple //languages //(English //-
> //Dutch, //English //-> //Spanish, //English //-> //Latin, //etc)
What //is //the //difference //between //interpreted //and //compiled //language?
STAGE //
1/
/CONTENT /
/QUESTION //- //CORRECT //ANSWERS(S)✔✔Interpreted //language //the //code //is //NOT //per-
compiled //and //the //code //is //compiled //and //translated //as //the //program //runs.
Compiled //Language //the //code //is //per-compiled //before //the //program //runs.
How //does //the //Java //Virtual //Machine //change //the //way //object //code //is //executed?
,STAGE //
1/
/CONTENT /
/QUESTION //- /
/CORRECT /
/ANSWERS(S)✔✔The /
/JVM /
/runs /
/Java /
/Byte /
/code, /
/which /
/is /
/compiled /
/from /
/high /
/level /
/language /
/code. /
/It /
/allows /
/for /
/less /
/porting /
/to //specific //machines //as //the //code //runs //on //a //JVM //and //then //the //JVM //translates //it //to //any
//machine //code.
How //doe //we //declare //a //variable
STAGE //1 //CONTENT //QUESTION //- //CORRECT //ANSWERS(S)✔✔<type> //<name> //= //<value>;
int //myAge //= //19;
What //do //we //mean //by //"type" //of //a //variable?
, STAGE //
1/
/CONTENT /
/QUESTION //- /
/CORRECT /
/ANSWERS(S)✔✔The /
/type /
/means /
/what //information //the //value //will //store //or //how //much //information //the //value //will //store. //
int //store //whole //numbers //doubles //stores //a //value //between //-
2million //something //to //2 //million //something
double //stores //an //int //with //higher //precision
etc //etc.
What //is //an //assignment //statement?
STAGE //
1/
/CONTENT /
/QUESTION //- /
/CORRECT /
/ANSWERS(S)✔✔An /
/assignment //statement //is //the //statement //that //stores //a //value //into //a //variable.
x //= //5; //is //an //example
int //x //= //5; //combines //the //declarement //statement //and //assignment //statement
Explain //what //this //code //accomplishes: