CSCI 102 - Fall 2023 Fundamentals of Computation

Final Info

Overview and Proces

MUST BE TAKEN IN PERSON / NO REMOTE EXAMS

Topics

The following is the list of topics that you should be familiar with. Use it as a guide to help your studying. While the final is cumulative, it will focus on strings, nested loops, arrays, and functions! Focus on those topics first.

Unit 0b

Unit 0c

Unit 1a

Unit 1b

Unit 1c

Unit 1d Conditional Statements

Unit 2a and 2b Loops

Unit 2c Arrays

Unit 2d Strings

Unit 3a Nested Loops

Unit 3b and 3d Array Tasks

Unit 3d Debugging

Unit 4a Call Functions

Unit 4b Defining Functions

Unit 4c Passing Arguments

Unit 4d Compilation and Debugging

Unit 4e Sorting

Ways to Prepare

  1. Study the slides
  2. Review labs.
  3. Redo the in-class exercises by clicking the “Reset To Scaffold” button. Focus on the array tasks and function tasks.
  4. Redo your HW/Lab exercises (especially the tracing exercises)
  5. Sample Fall 2020 Final on Gradescope
  6. Sample Spring 2021 Final on Gradescope
  7. Go through the review problems at the end of each relevant chapter in the textbook. Some selected problems from the 2nd edition:
    • Ch. 5
      • P5.6-5.7
      • P5.10 (rather than choosing a random, internal pair to flip, exchange the character at index n/2 and the preceding character where n is the length of the string, and n >= 4). Do nothing (return) the string if its length is less than 4.
      • P5.12
      • P5.25 (implement a function int zipFromBarCode(string bar) that returns the zip code or -1 if there is an error)
    • Ch. 6
      • P6.17,
      • P6.21-23
      • P6.31
  8. Other practice problems
    • Implement the function: int insertRun(int vals[], int currSize, int maxSize, int start, int num, int n);
      • This function takes an array of integers, vals that was declared to be of size, maxSize, but that currently is only using the first currSize elements. Insert the n values: num, num+1, num+2, … at the index start, moving the original elements occupying those locations to the right. Return the new number of occupied/used elements in the array. If adding n elements would cause the array to grow beyond maxSize, do nothing and return -1.
        • So given an array: int vals[20] = {99,98,97,96};
        • A call to insertRun(vals, 4, 20, 2, 10, 5) would update the array contents to: {99,98,10,11,12,13,14,97,96} and return 9
        • A call to insertRun(vals, 4, 20, 2, 10, 17) would update the array contents to: {99,98,10,11,12,13,14,97,96} and return -1 because adding 17 elements to the 4 that already exist would go beyond the 20 locations.