Final exam Review - PowerPoint PPT Presentation

1 / 45
About This Presentation
Title:

Final exam Review

Description:

Unfortunately, the same does not hold for shell scripts ... Shell scripts questions will be asked. ... Write a shell script to read an input from the user and ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 46
Provided by: axgo
Category:
Tags: exam | final | review

less

Transcript and Presenter's Notes

Title: Final exam Review


1
Final exam Review
2
Review Outline
  • Pattern of final.
  • Study guide.
  • Listed by lectures.
  • Sample questions.
  • From some important topics.

3
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.

4
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.

5
Important topics
  • Lectures 1 3
  • Important characteristics of Unix.
  • Usage of commands
  • chmod, wc, grep

6
Important topics
  • Lectures 4 5
  • Unix shell.
  • Different kinds of shells.
  • Unix command line.
  • History of commands.
  • Pipes and filters.

7
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.

8
Important topics
  • Lecture 8
  • Types of operators.
  • Precedence of operators.
  • Evaluation of expressions.

9
Important topics
  • Lecture 9
  • Formatted I/O.
  • printf () formatted output.
  • scanf () formatted input.
  • Single character I/O.

10
Important topics
  • Lecture 10
  • Functions.
  • C library functions and their header files.

11
Important topics
  • Lecture 11
  • Relational operators.
  • Equality operators.
  • Logical operators.
  • Conditional operators.
  • Precedence and evaluation of these operators.

12
Important topics
  • Lectures 12 14
  • User defined data types.
  • structures, enumerated types, unions.
  • Declaration of these data types.

13
Important topics
  • Lecture 15
  • Dynamic memory allocation.
  • Functions to allocate memory.
  • Functions to de-allocate memory.

14
Important topics
  • Lecture 16
  • Opening a file.
  • Closing a file.
  • Reading/Writing from files.

15
Important topics
  • Lecture 17
  • Storage classes.
  • Global variables, scope, visibility.
  • Compiling and linking program modules.

16
Important topics
  • Lecture 18
  • C preprocessor.
  • Macros
  • Preprocessing directives.

17
Important topics
  • Lecture 19
  • Recursion.
  • Advantages of recursion.
  • Dis-advantages of recursion.

18
Important topics
  • Lectures 20 21
  • Examples on file parsing.
  • fprintf and fscanf functions.
  • fgets and fputs functions.
  • fgetc and fputc functions.

19
Important topics
  • Lecture 22
  • Binary, octal and hexadecimal number systems.
  • Bit wise operations.
  • Memory representation of ints and chars.

20
Important topics
  • Lecture 23
  • Shell variables.
  • Shell environment variables.
  • Declaring and un-declaring variables.

21
Important topics
  • Lecture 24
  • Writing shell scripts.
  • Conditional statements.
  • Loop statements.
  • Shell operators.
  • expr command.

22
Important topics
  • Lecture 25
  • Shell command line.
  • Processing the command line.
  • Reading user input.
  • Dynamic memory allocation examples.

23
Final exam (contd.)
  • No programs will be asked to be written.
  • This means that you dont have to write complete
    C programs.

24
Final exam (contd.)
  • No questions on the background and history of the
    development of Unix or C will be asked.

25
Final exam (contd.)
  • Functions will not be asked to be written.

? No questions on character pointers ?
? No questions on switch-case ?
26
Final exam (contd.)
  • Snippets of code will be asked.
  • E.g
  • Dynamically allocated variables and arrays.
  • File operations.

27
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.

28
Final exam (contd.)
  • For snippets of C code, dont worry too much
    about syntax mistakes ?

? Unfortunately, the same does not hold for shell
scripts ?
? You dont need to worry about include files ?
29
Final exam (contd.)
  • For writing Unix/AFS commands, dont worry about
    the prompt.

? You do have to worry about case sensitivity. ?
In Unix, Ls ! ls
30
Exam questions
  • The type of questions will be similar to the
    mid-term.
  • Most questions will be implementation based
    rather than theory.

31
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. ?
32
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.

? Dont worry, only simple scripts will be asked ?
33
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.

34
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.

35
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.

36
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.

37
Exam questions
  • Some definitions will be asked.
  • Sample questions
  • Define a shell variable.
  • Define an environment variable.
  • Etc. etc.

38
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.

39
Exam questions
  • For expression evaluation, show your working
    clearly
  • Will help you get partial credit, if you dont
    get the answer right.

40
Exam questions
  • Questions on bit wise operators and operations
    will be asked.
  • Sample questions
  • Calculate x y where x 100, y 111.
  • Calculate x ltlt 1 where x 101.
  • Etc. etc.

41
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.

42
Exam questions
  • For base conversion problems, show your working
    clearly.
  • Can help you get credit if you dont get the
    final answer correct.

43
Final exam (contd.)
  • Final exam will be held in the same room as the
    lectures.
  • Time of the exam is between 2 and 350 pm.
  • Extra time will depend on whether we have another
    exam after ours in the same room.

? Very very unlikely ? ? YIPEE !! extra time
44
Final exam (contd.)
  • As mentioned earlier, it will be open books and
    open notes.
  • Make sure that you organize your notes, so that
    you dont spend most of your exam time hunting
    for notes ?

45
Final exam (contd.)
  • Extra paper for the exam will be provided.
  • Write as legibly as possible (most importantly
    your name).
  • Good luck ?
Write a Comment
User Comments (0)
About PowerShow.com