Quizzes

We will have regular quizzes that will be based on the material covered in class and any assigned reading or provided online material.

Quizzes will be based on student submitted questions.

Please read all of the information below carefully and pay attention to the quiz submission format I give below. Quiz submissions that do not match the formats below will be denied and not given participation credit. Also, double check your spelling, grammar, any typos, and the supplied answers.

For each quiz I will provide a Quiz Submission Folder on Piazza. For example, the Quiz 1 folder will be called “quiz1”. Each student must submit one quiz question publicly to the quiz folder. Note that you must submit a quiz question that is different from all the quiz questions that have  been submitted at the time you submit your questions. This means it is a good idea to submit questions earlier rather than later. You can submit your questions anonymously if you want, but it is not required.

Quiz questions can be true or false or multiple choice. You should provide a “Topic”, the questions, possible answers, and an “Explanation.” They should be written clearly. The TAs and I will review all submitted quiz questions and we will approve, deny, or correct each question. If we deny a question, you need to submit a new question.

On the day of the quiz, you will be given 10 questions selected from the approved set of submitted questions. In this way, you should have seen all the possible questions and their answers. We will use the quiz functionality in Canvas for taking quizzes.

Note, I will need your collective help to make sure that we have a good range of questions for each quiz. So, try to be creative in your questions and look at the current set of submissions to make sure you provide a question on a different concept. Also, think of questions regarding concepts that you initially found difficult, but now understand from class or the reading. I reserve the right to add my own quiz questions to the quiz submissions if I feel that we are missing questions on some important concepts.

For multiple choice questions, please format your question as following:

Topic: Data sizes
How many bits are in a byte?
2
4
8 (*)
16
Explanation: By definition a byte consists of 8 bits.

Notice that you need to provide an explanation or justification for the correct answer. This will not show up in the actual quiz, but you need to convince everyone why your supplied correct answer is in fact correct. For multiple choice you can choose to provide up to 4 answers, with one correct answer. You should have no fewer than 2 answers. Indicate the correct answer with (*). For true or false questions use the following format:

Topic: C types
The size of the C type (int *) is always 4 bytes.
True
False (*)
Explanation: The size of a pointer is dependent on the compiler, operating system, and native word size of the processor.

Be sure to phrase true or false question as a statement that needs to be determined to be true or false. Again, you need to provide and explanation for your supplied answer.

Here are a couple more examples:

Topic: C global and local variables
Consider the following C program.

#include <stdio.h>
int x = 1;
int main(int argc, char **argv)
{
    int x = 2;
    printf("x = %d", x);
    return 0;
}

What is the output of this program?
1
2 (*)
Explanation: Variables in C follow lexical scoping. In this case the local variable x in main takes priority over the global x.

Another example:

Topic: C strings
Consider the following variable definition:

char *str = "hello\n";

How many bytes of memory are needed to store this string in memory?
5
6
7 (*)
8
Explanation: There are bytes for “hello”, one byte for “\n”, and one more byte for the null terminator that is provided by the C compiler and is necessary for all C strings to have.

One last example:

Topic: C pointers
A C pointer value is an address to a location in memory.
True (*)
False
Explanation: In C, we can access memory locations using pointers. All pointer variables hold a value that is an address to a location in memory.


Subpages (2): Quiz01 Quiz02
Comments