Mid-term Review

Document Sample
Mid-term Review Powered By Docstoc
					Final exam Review
             Review: Outline
 Pattern of final.
 Study guide.
   – Listed by lectures.
 Sample questions.
   – From some important topics.
                Final exam
 Format:
  – Similar to the mid-term.
  – 25 true/false questions.
  – 10 short answer questions.
  – 3 long answer questions.
  – 1 other question.
  – Graded on a scale of 100 points.
         Final exam (contd.)
 Important topics:
  – Available on the hand out and also online:
     • www.cs.pitt.edu/~axgopala/cs132/guide/topics.ps
     • www.cs.pitt.edu/~axgopala/cs132/guide/topics.pdf
  – Contains the important topics covered on the
    exam.
  – The topics will be covered in more detail in
    this class.
           Important topics
 Lectures 1 – 3:
  – Important characteristics of Unix.
  – Usage of commands:
     • chmod, wc, grep …
            Important topics
 Lectures 4 – 5:
  – Unix shell.
     • Different kinds of shells.
  – Unix command line.
  – History of commands.
  – Pipes and filters.
           Important topics
 Lectures 6 – 7:
  – Stages in writing and compiling a C program.
  – Compiling a C program, and its errors.
  – Different kinds of data types.
  – Variables and constants.
           Important topics
 Lecture 8:
  – Types of operators.
  – Precedence of operators.
  – Evaluation of expressions.
            Important topics
 Lecture 9:
  – Formatted I/O.
     • printf () – formatted output.
     • scanf () – formatted input.
  – Single character I/O.
            Important topics
 Lecture 10:
  – Functions.
     • C library functions and their header files.
           Important topics
 Lecture 11:
  – Relational operators.
  – Equality operators.
  – Logical operators.
  – Conditional operators.
  – Precedence and evaluation of these operators.
            Important topics
 Lectures 12 – 14:
  – User defined data types.
     • structures, enumerated types, unions.
  – Declaration of these data types.
           Important topics
 Lecture 15:
  – Dynamic memory allocation.
  – Functions to allocate memory.
  – Functions to de-allocate memory.
            Important topics
 Lecture 16:
  – Opening a file.
  – Closing a file.
  – Reading/Writing from files.
            Important topics
 Lecture 17:
  – Storage classes.
  – Global variables, scope, visibility.
  – Compiling and linking program modules.
             Important topics
 Lecture 18:
  – C preprocessor.
  – Macros
  – Preprocessing directives.
           Important topics
 Lecture 19:
  – Recursion.
  – Advantages of recursion.
  – Dis-advantages of recursion.
            Important topics
 Lectures 20 – 21:
  – Examples on file parsing.
  – fprintf and fscanf functions.
  – fgets and fputs functions.
  – fgetc and fputc functions.
           Important topics
 Lecture 22:
  – Binary, octal and hexadecimal number
    systems.
  – Bit wise operations.
  – Memory representation of ints and chars.
            Important topics
 Lecture 23:
  – Shell variables.
  – Shell environment variables.
  – Declaring and un-declaring variables.
            Important topics
 Lecture 24:
  – Writing shell scripts.
  – Conditional statements.
  – Loop statements.
  – Shell operators.
  – expr command.
           Important topics
 Lecture 25:
  – Shell command line.
  – Processing the command line.
  – Reading user input.
  – Dynamic memory allocation examples.
         Final exam (contd.)
 No programs will be asked to be written.
  – This means that you don’t have to write
    complete C programs.
        Final exam (contd.)
 No questions on the background and
  history of the development of Unix or C
  will be asked.
         Final exam (contd.)
 Functions will not be asked to be written.



   No questions on character pointers 

       No questions on switch-case 
           Final exam (contd.)
 Snippets of code will be asked.
  – E.g:
     • Dynamically allocated variables and arrays.
     • File operations.
         Final exam (contd.)
 Unix commands will be asked.
  – See the hand out for important topics.
  – Includes some AFS commands.
 You should be able to write the Unix
  commands asked of you.
           Final exam (contd.)
 For snippets of C code, don’t worry too
  much about syntax mistakes 

 Unfortunately, the same does not hold for shell scripts 

       You don’t need to worry about include files 
         Final exam (contd.)
 For writing Unix/AFS commands, don’t
  worry about the prompt.


 You do have to worry about case sensitivity. 


                 In Unix, Ls != ls
           Exam questions
 The type of questions will be similar to the
  mid-term.
 Most questions will be implementation
  based rather than theory.
             Exam questions
 For the topics mentioned, some sample
  questions are provided.


    These are just questions to give you an idea. 


     None of these will be directly on the exam. 
             Exam questions
 Shell scripts questions will be asked.
  – Make sure that you are well versed with
    writing some simple scripts.
  – Remember to mention the shell for which the
    script is written for.



    Don’t worry, only simple scripts will be asked 
            Exam questions
 Sample shell script questions:
  – Write a shell script to read an input from the
    user and print out its value.
  – Write a shell script which will find out the
    hostname of the current machine and print it.
                Exam questions
 More shell script questions:
  – Write a shell script to write the multiplication
    table of 9.
  – Write a shell script to find out if a string is in a
    particular file by using the command line.
  – Etc. etc.
            Exam questions
 Questions on shell variables will be asked.
 Sample questions:
  – Declare a shell variable foo in the C shell
    which has value run to the hills.
  – Declare an environment variable in bash.
  – Define a shell variable.
  – Etc. etc.
            Exam questions
 Remember while working with shell
  commands and shell variables syntax is
  very very important.
  – E.g:
     • echo PATH is wrong  you missed the $.
     • var = 100 is wrong  no space should be there.
                Exam questions
 Some definitions will be asked.
 Sample questions:
  – Define a shell variable.
  – Define an environment variable.
  – Etc. etc.
            Exam questions
 Evaluation of arithmetic and logical
  expressions will be asked.
 Sample questions:
  – Calculate the result of the following
    expression: x++ - --y; where x = 1; y = 4.
  – Calculate the result of the following
    expression: x && y – z; where x = 3; y = 1
    and z = 10.
  – Etc. etc.
            Exam questions
 For expression evaluation, show your
  working clearly
  – Will help you get partial credit, if you don’t
    get the answer right.
                Exam questions
 Questions on bit wise operators and
  operations will be asked.
 Sample questions:
  – Calculate x & y; where x = 100, y = 111.
  – Calculate x << 1; where x = 101.
  – Etc. etc.
                Exam questions
 Questions on conversion to different
  number systems will asked.
 Sample questions:
  – Convert 1101 (in binary) to decimal.
  – Convert 7 (in octal) to decimal.
  – Convert a0 (in hex) to decimal.
  – Etc. etc.
            Exam questions
 For base conversion problems, show your
  working clearly.
  – Can help you get credit if you don’t get the
    final answer correct.
        Final exam (contd.)
 Final exam will be held in the same room
  as the lectures.
 Time of the exam is between 2 and 3:50
  pm.
 Extra time will depend on whether we have
  another exam after ours in the same room.

  Very very unlikely   YIPEE !! extra time
         Final exam (contd.)
 As mentioned earlier, it will be open books
  and open notes.
 Make sure that you organize your notes, so
  that you don’t spend most of your exam
  time hunting for notes 
         Final exam (contd.)
 Extra paper for the exam will be provided.
 Write as legibly as possible (most
  importantly your name).
 Good luck 

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:3
posted:9/14/2012
language:Latin
pages:45