Mixed Programming Languages Quiz: SAS, ABAP, and Java
A quiz covering concepts from multiple programming languages including SAS PROC SQL queries, ABAP Dictionary and events, Java collections and syntax, and general programming language theory.
Questions
class C { public static void main (String[] a1) { System.out.print(a1[1] + a1[2] + a1[3]); }} What is the result of attempting to compile and run the program? java command A B C
- Prints: ABC
- Prints BC and Runtime Exception
- Prints: BCD
- Runtime Exception
- None of the above
class C{ static int s; public static void main(String a[]){ C obj=new C(); obj.m1(); System.out.println(s); } void m1(); { int x=1; m2(x); System.out.println(x+""); } void m2(int x){ x=x*2; s=x; }}
- prints 1,2
- prints 2,0
- prints 2,2
- compile time error
- Noneofthe above
class C { public static void main(String[] args) { int i1=1; switch(i1){ case 1: System.out.println("one"); case 2: System.out.println("two"); case 3: System.out.println("three"); }}} What is the result of attempting to compile and run the program?
- prints one two three
- prints one
- compile time error
- Runtime exception
- None of the above
Each element must be unique Duplicate elements must not replace old elements. Elements are not key/value pairs. Accessing an element can be almost as fast as performing a similar operation on an array. Which of these classes provide the specified features?
- LinkedList
- TreeMap
- HashMap
- HashSet
What is necessary for a programming language?
- For loop
- While loop
- Recursion
- All of these
Identify the true statement.
- For efficient program writing, we need syntax which is not strict
- For efficient program writing, we need syntax which is strict
- For quick compiler design, syntax is strict
- Syntax strictness and compiler design are not related
Programming is the job of ____
- Developer
- Maintenance Person
- Both developer and maintenance person
- Tester
Name the type of ABAP Dictionary table that has these characteristics: Same number of fields as the database table Same name as database table Maps 1:1 to database table
- Pooled
- Cluster
- Transparent
- View
An event starts with an event keyword and ends with:
- Program execution
- END-OF-EVENT
- Another event keyword
- END-EVENT
Which of the following is NOT a required attribute when creating an ABAP program? A: Application B: Title C: Status D: Type
- A&C
- A&D
- C&D
- B&D
Coding two INITIALIZATION events will cause a syntax error.
- True
- False
When creating a transparent table in the ABAP Dictionary, which step automatically creates the table in the underlying database?
- Adding technical settings to the table
- Checking the table syntax
- Saving the table
- Activating the table
A field declared as type T has the following internal representation
- SSMMHH
- HHMMSS
- MMHHSS
- HHSSMM
If you use a RUN statement with a PROC SQL step
- SAS ignores the RUN statement, executes the statements as usual.
- Stop running due to error.
- Executes the code with a warning note
- Unexpected Result.
Complete the SELECT clause below to create a new column named Profit by subtracting the values of the column Cost from those of the column Price. select fruit,cost,price, ________________
- Profit=price-cost
- price-cost as Profit
- profit=price-cost
- Profit as price-cost
Which PROC SQL query will remove duplicate values of MemberType from the query output, so that only the unique values are listed?
- proc sql nodup; select membertype from sasuser.frequentflyers;
- proc sql; select distinct(membertype) as MemberType from sasuser.frequentflyers;
- proc sql; select unique membertype from sasuser.frequentflyers group by membertype;
- proc sql; select distinct membertype from sasuser.frequentflyers;
What happens if you use a GROUP BY clause in a PROC SQL step without a summary function?
- The step does not execute.
- The first numeric column is summed by default.
- The GROUP BY clause is changed to an ORDER BY clause.
- The step executes but does not group or sort data.
Which clause in the following program is incorrect? proc sql; select sex,mean(weight) as avgweight from company.employees company.health where employees.id=health.id group by sex;
- SELECT
- FROM
- WHERE
- GROUP BY
You are creating a PROC SQL query that will list all employees who have spent (or overspent) their allotted 120 hours of vacation for the current year. The hours that each employee used are stored in the existing column Spent. Your query defines a new column, Balance, to calculate each employee’s balance of vacation hours. Which query will produce the report that you want?
- proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where balance <= 0
- proc sql; select name, spent, 120-spent as Balance from Company.Absences where calculated balance <= 0;
- proc sql; select name, spent, 120-spent as Balance from Company.Absences where balance <= 0;
- proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where calculated balance <= 0;
What is the purpose of the following statement ---- PROC SQL INOBS= 10;
- Restricts the number of rows (observations) that PROC SQL retrieves from any single source.
- Restricts the number of rows (observations) that PROC SQL can print.
- Directs the system to start reading the source from 10th observation.
- None of the above.