Exam Format 90 Total Points 60 Points Writing Programs 25 Points Tracing Code/Algorithms and...

13

Transcript of Exam Format 90 Total Points 60 Points Writing Programs 25 Points Tracing Code/Algorithms and...

Page 1: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.
Page 2: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Exam Format

90 Total Points 60 Points Writing Programs 25 Points Tracing Code/Algorithms and

determining results 5 Points Short Answer

Similar to quizzes and programming assignments

Page 3: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Example Programming Problem

Write a function that accepts two parameters: an array of integers and the number of integers in the array. Return an integer representing the number of odd integers in the array.

Page 4: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Example Tracing Problem What will the EXACT output of the

following program be? int foo = 9;

int *ptr = &foo;

float foo2 = 5.7;

*ptr = 2;

foo2 = foo - foo2;

if (foo > foo2)

cout << "Hello!";

else if (foo < foo2)

cout << foo2;

else

cout << foo;

cout << endl;

cout << "foo2 is: " << fixed

<< setprecision(1) << foo2 << endl;

Page 5: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Example Short Answer

Of what order of magnitude is a Bubble Sort?

Page 6: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Arrays

40 points One and two-dimensional arrays

Declaration of various types traversing Difference between physical and logical size

Passing arrays as parameters Arrays of records

Understand tsuPod program Strings

Know how to use the string functions such as length(), substr()

Know how to use a string like an array of characters Understand BioHelp and Exam Grader programs

2-D arrays Understand Game of Life program

Page 7: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Structures

10 points Know how to declare a structure Know how to access the fields in a

structure Arrays of structures

Understand tsuPod program

Page 8: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Analysis of Algorithms

10 Points Be able to look at code or algorithm and

make an educated guess at the order of magnitude Look to see if the statement that is executed

the most is a function of the size of the data set

Know which orders are faster and slower than the others Constant time algorithms are denoted as O(1) O(log2n), O(n), O(n2), O(2n)

There are more

Page 9: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Searching and Sorting

15 Points May have to write sequential search, but not

the others. Know the algorithms and the order of

magnitude of each Sequential search Binary search Bubble sort Selection sort

Will not have to write a sorting algorithm.

Page 10: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Pointers

10 Points A pointer is a variable that holds the

address of a memory location Declaration int *ptr;

Assignment ptr = &foo; //& is the address function

Dereferencing *ptr = 54; //same as foo=54;

You can point to any kind of data type Relationship between arrays and pointers Understand the “new” and “delete”

commands

Page 11: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

How to Study

Rewrite all the programs. Redo labs. Learn by doing and recognizing

patterns. Don’t stay up late!! Get some sleep

and eat a good breakfast.

Page 12: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

What to bring

Pencils and erasers We will provide scratch paper No calculators

Page 13: Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.

Questions