Pagini

marți, 12 martie 2013

Section 2 Lesson 7: Good Programming Practices


Good Programming Practices

Section 1
   
  1.  Comments change how a PL/SQL program executes, so an unsuitable comment can cause the program to fail. True or False?  (1) Points
   
    True
    False (*)
   
  2.  Examine the following code:
DECLARE
v_first_name varchar2 (30);
v_salary number (10);
BEGIN
SELECT first_name, salary
INTO v_first_name, v_salary
FROM employees
WHERE last_name = 'King';
END;

Which programming guideline would improve this code?
(1) Points
   
    Use a suitable naming convention for variables.
    Indent the code to make it more readable. (*)
    Use upper and lower case consistently.
   
  3.  What symbol is used to comment a series of lines?  (1) Points
   
    / / before and after the comment
    /* */ before and after the comment (*)
    * * before and after the comment
   
  4.  Which of the following are examples of good programming practice? (Choose two.) (1) Points
  (Choose all correct answers)
   
    Use the %TYPE attribute to declare a variable according to another previously declared variable or database column. (*)

    Declare one or more identifiers per line for improved performance.
    For clarity, use column names as identifiers.
    Use meaningful names for identifiers. (*)

  5.  Which of the following are examples of good programming practice? (Choose three.)  (1) Points
   (Choose all correct answers)
   
    Document code with comments. (*)
    Use implicit data type conversions.
    Develop naming conventions for identifiers and other objects. (*)
    Indent code so that it can be read more easily. (*)
    Use table column names as the names of variables.

  6.  Which of the following makes PL/SQL code easier to read and maintain?  (1) Points
   
    Place multiple statements on the same line.
    Type everything in lowercase.
    Use suitable comments in the code. (*)

Un comentariu:

  1. It was wondering if I could use this write-up on my other website, I will link it back to your website though. Great Thanks.

    java forums

    RăspundețiȘtergere