Tag: programming languages

Questions Related to programming languages

  1. proc sql; update work.frequentflyers set pointsearned=pointsearned* case if milestraveled < 10000 then 1.5 if milestraveled >= 10000 then 2 else 1 end;

  2. proc sql; update work.frequentflyers set pointsearned=pointsearned* case when milestraveled < 10000 then 1.5 when milestraveled >= 10000 then 2 else 1 end;

  3. proc sql; update work.frequentflyers set pointsearned=pointsearned* case if milestraveled < 10000 then pointsearned*1.5 if milestraveled >= 10000 then pointsearned*2 else 1 end;

  4. proc sql; update work.frequentflyers set pointsearned=pointsearned* case if milestraveled < 10000 then pointsearned*1.5 if milestraveled >= 10000 then pointsearned*2 else pointsearned*1 end;


Correct Option: B
  1. proc sql; describe as select * from sasuser.payrollmaster;

  2. proc sql; describe contents sasuser.payrollmaster;

  3. proc sql; describe table sasuser.payrollmaster;

  4. proc sql; describe * from sasuser.payrollmaster;


Correct Option: C
  1. Custom Attributes

  2. Funtional Attributes

  3. Predefined Attributes

  4. Both A & C


Correct Option: D
  1. You can call a method on null: x.m() will not throw an error when x is null and m is a static method.

  2. null instanceof Object returns true

  3. You can pass null as the literal argument to a constructor of an anonymous inner class. e.g., new SomeClass(null) { }

  4. None of above


Correct Option: A
  1. Adding state variables breaks referential transparency (you no longer can understand a statement or expression on its own: you need to understand it in the context of the settings of the global variables)

  2. State variables lessen the cohesion of a program: you need to know more to understand how something works. A major point of Object-Oriented programming is to break up global state into more easily understood collections of local state.

  3. When you add one variable, you limit the use of your program to one instance. What you thought was global, someone else might think of as local: they may want to run two copies of your program at once.

  4. All of above


Correct Option: D