C Programming Course Assessment Quiz
42 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What percentage of the final grade do the quizzes contribute?

  • 5% (correct)
  • 10%
  • 20%
  • 15%
  • Students are allowed to miss more than one quiz without penalty.

    False (B)

    What is required for an assignment or lab exercise to receive a grade?

    A minimum credible attempt

    Lab Exam 1 contributes _____ of the final grade.

    <p>5%</p> Signup and view all the answers

    Match the assessment type with its grade contribution:

    <p>Quizzes = 5% Lab Exam 1 = 5% Lab Exam 2 = 10% Discussion = 5%</p> Signup and view all the answers

    Which of the following is a valid example of a floating-point constant?

    <p>125.8 (A)</p> Signup and view all the answers

    The printf() function uses the format specifier %e for printing floating-point numbers.

    <p>False (B)</p> Signup and view all the answers

    What is the value of 2.25e-3 in decimal form?

    <p>0.00225</p> Signup and view all the answers

    Floating-point constants can also be expressed in __________ notation.

    <p>scientific</p> Signup and view all the answers

    Match the floating-point types with their descriptions:

    <p>float = Used for single-precision floating-point numbers double = Used for double-precision floating-point numbers %f = Format specifier for float in printf() %e = Format specifier for scientific notation in printf()</p> Signup and view all the answers

    Which book is primarily used for C programming in this course?

    <p>Programming in C (C)</p> Signup and view all the answers

    The course covers LINUX/UNIX Systems Basics for one week.

    <p>False (B)</p> Signup and view all the answers

    What is the primary focus of the course regarding programming practice?

    <p>To practice programming through various guides and materials posted on Canvas.</p> Signup and view all the answers

    The course includes topics on ________ memory, focusing on stack and heap differences.

    <p>Dynamic</p> Signup and view all the answers

    Match the following topics with their corresponding time allocations:

    <p>C Basics = 1.5 weeks Program memory = 2 weeks Larger programs and libraries = 0.5 weeks Dynamic memory = 1 week</p> Signup and view all the answers

    Which section will include custom data types using typedef?

    <p>Program memory (A)</p> Signup and view all the answers

    Branching and looping are covered under C Basics.

    <p>True (A)</p> Signup and view all the answers

    What does the course aim to teach regarding pointers?

    <p>The course aims to teach about pointers, pointer arithmetic, and their applications in programming.</p> Signup and view all the answers

    What is the weight of the final exam in achieving a passing grade?

    <p>35% (A)</p> Signup and view all the answers

    Completing the Academic Integrity Tutorial contributes to the final grade weight.

    <p>False (B)</p> Signup and view all the answers

    List one reason why a student might be required to attend office hours.

    <p>To ask questions about lecture materials or assignments.</p> Signup and view all the answers

    In order to achieve a passing grade, students must pass the ________ and ________.

    <p>lab exam 2, final exam</p> Signup and view all the answers

    Match the following assessments with their respective weights:

    <p>Assignments = 15% Midterm exam = 15% Lab exam 2 = 10% Quizzes = 5%</p> Signup and view all the answers

    Which of the following assessments has the lowest weight?

    <p>Quizzes (C)</p> Signup and view all the answers

    Students are allowed to fail both lab exams and still pass the course.

    <p>False (B)</p> Signup and view all the answers

    Who are the teaching assistants for the labs?

    <p>Ardalan Askarian, Matthew Delorme, Spencer O'Lain, Mark Jia, McKayla Boguski.</p> Signup and view all the answers

    What is the format specifier used to print a long integer in C?

    <p>%ld (C), %li (D)</p> Signup and view all the answers

    A short int can take up less than 16 bits of storage space.

    <p>False (B)</p> Signup and view all the answers

    What is the minimum guaranteed width of a long long int in C?

    <p>64 bits</p> Signup and view all the answers

    The format specifier for printing a long double in C is ___

    <p>%Lf</p> Signup and view all the answers

    Match the following type specifiers with their correct descriptions:

    <p>long int = At least 32 bits wide long long int = Guaranteed to be at least 64 bits wide short int = Uses less memory than regular int long double = Used for high-precision floating-point values</p> Signup and view all the answers

    What type of values does a short int store?

    <p>Fairly small integer values (B)</p> Signup and view all the answers

    The L modifier is used when printing floating-point values of type long double.

    <p>True (A)</p> Signup and view all the answers

    To declare a long double variable, the correct syntax is long double ___ = 1.234e+7L;

    <p>largeNumber</p> Signup and view all the answers

    What does the post-increment operator i++ do?

    <p>Increases i by 1 after using it in an expression. (A)</p> Signup and view all the answers

    The pre-increment operator is executed after the expression is evaluated.

    <p>False (B)</p> Signup and view all the answers

    What is the general format of a for loop in programming?

    <p>for (initial-statement; loop-condition; loop-statement)</p> Signup and view all the answers

    In a for loop, the __________ is checked before the loop body is executed.

    <p>loop-condition</p> Signup and view all the answers

    Match the operators with their functions:

    <p>++i = Pre-increment operator i++ = Post-increment operator --i = Pre-decrement operator i-- = Post-decrement operator</p> Signup and view all the answers

    Which statement about relational operators is true?

    <p>They have lower precedence than all arithmetic operators. (B)</p> Signup and view all the answers

    If i = 3 and x = ++i + 2, what will be the value of x after this operation?

    <p>6</p> Signup and view all the answers

    In a for loop, the initial-statement runs only once for each iteration of the loop.

    <p>False (B)</p> Signup and view all the answers

    Flashcards

    C Programming

    A programming language emphasizing system programming, embedded systems, and low-level manipulation of computer resources.

    Programming Practice

    Practical application of programming skills, often involving debugging, testing, and style guidelines.

    LINUX/UNIX

    A family of operating systems characterized by its command-line interface and modular design.

    Variables and Data types

    Storing values (integers, floats, characters, etc.).

    Signup and view all the flashcards

    Functions

    Modular blocks of code that perform specific tasks.

    Signup and view all the flashcards

    Pointers

    Variables that store memory addresses rather than values.

    Signup and view all the flashcards

    Multi-module programs

    Large software programs broken into smaller, manageable units.

    Signup and view all the flashcards

    Dynamically-linked libraries

    Program modules that load and link during runtime.

    Signup and view all the flashcards

    Discussion Assignments

    Discussions focusing on the reasons behind tools, principles, and practices in software development, not the mechanics.

    Signup and view all the flashcards

    Quizzes

    5 in-class, paper-based quizzes; one unexcused absence allowed.

    Signup and view all the flashcards

    Minimum Credible Attempt (MCA)

    All assignments and labs require a basic, functional implementation; Must compile.

    Signup and view all the flashcards

    Lab Exam 1

    A lab exam worth 5% of the final grade, similar in format to lab exercises.

    Signup and view all the flashcards

    Lab Exam 2

    A lab exam worth 10% of the final grade with the same format as lab exercises.

    Signup and view all the flashcards

    Final Exam Weight

    35% of the overall grade in the course.

    Signup and view all the flashcards

    Passing the Class

    Requires completing all mandatory components and passing the final exam.

    Signup and view all the flashcards

    Lab Exam 2 Weight

    10% of the coursework grade.

    Signup and view all the flashcards

    Midterm Exam Weight

    15% of the course grade.

    Signup and view all the flashcards

    Assignments Weight

    15% of the overall grade.

    Signup and view all the flashcards

    Lab Exercises Weight

    10% of the course grade.

    Signup and view all the flashcards

    On-line Discussions Weight

    5% of the course grade.

    Signup and view all the flashcards

    Academic Integrity Tutorial

    Does not count toward the final grade.

    Signup and view all the flashcards

    Floating-point constants

    Numbers with decimal points, used to represent real numbers in C. Examples include 125.8 and -.0001.

    Signup and view all the flashcards

    Scientific notation for floating-point values

    Representing a very large or small number using a mantissa (the number before the 'e') and an exponent (the power of 10 after the 'e'). Example: 1.7e4 (1.7 * 10^4).

    Signup and view all the flashcards

    Mantissa

    The numerical part of a floating-point value in scientific notation, located before the 'e'. Example: 1.7 in 1.7e4.

    Signup and view all the flashcards

    Exponent in scientific notation

    The power of 10, represented by the part after the 'e' in scientific notation. Example: 4 in 1.7e4.

    Signup and view all the flashcards

    The 'double' type

    A data type for storing floating-point numbers with higher precision than the 'float' type, used when the range provided by a float is insufficient.

    Signup and view all the flashcards

    Post-increment operator

    The value of the variable is used first, and then incremented by 1.

    Signup and view all the flashcards

    Pre-increment operator

    The variable is incremented by 1 first, and then its value is used in the expression.

    Signup and view all the flashcards

    Increment/Decrement Operators

    They modify the value of a variable by adding or subtracting 1 (i++, ++i, i--, --i).

    Signup and view all the flashcards

    for statement

    A loop structure that executes a block of code repeatedly based on a condition. It has three parts: initialization, condition check, and update.

    Signup and view all the flashcards

    Initial statement in for loop

    This part executes only once at the beginning of the loop, before the first iteration.

    Signup and view all the flashcards

    Loop condition in for loop

    This part is checked before each iteration of the loop. If true, the loop body is executed.

    Signup and view all the flashcards

    Loop statement in for loop

    This part is executed after each iteration of the loop body, often used to update a counter variable.

    Signup and view all the flashcards

    Relational Operators

    They compare values using symbols like == (equal to), != (not equal to), < (less than), > (greater than), <= (less than or equal to), and >= (greater than or equal to).

    Signup and view all the flashcards

    long int

    Data type used for larger integer values in C. Provides more storage capacity than standard 'int'.

    Signup and view all the flashcards

    %li or %ld

    Format specifiers used with 'printf()' to display 'long int' values.

    Signup and view all the flashcards

    long long int

    An even larger integer data type in C, offering more storage and potentially different ranges based on system architecture.

    Signup and view all the flashcards

    %lli format character

    Used with 'printf()' to display values of the 'long long int' data type.

    Signup and view all the flashcards

    long double

    Data type in C for high-precision floating-point numbers (numbers with decimal points).

    Signup and view all the flashcards

    %Lf or %Le

    Format specifiers used with 'printf()' to display 'long double' values. %Lf for floating-point notation, %Le for scientific notation.

    Signup and view all the flashcards

    short int

    Data type for storing relatively small integer values, saving memory and potentially improving execution speed.

    Signup and view all the flashcards

    Minimum size of 'short int'

    A 'short int' guarantees a minimum storage space of 16 bits, regardless of the specific system architecture.

    Signup and view all the flashcards

    Study Notes

    Course Information

    • Course name: CMPT 214 Programming Principles and Practice
    • Lecture 0: Introduction and Admin/UNIX basics
    • Required textbooks:
      • Kochan, Programming in C, 4th edition, 2014.
      • Sobell, Practical Guide to Linux Commands, Editors, and Shell Programming, 4th edition, 2017.
    • Recommended textbooks:
      • Kernighan and Ritchie, The C programming language, 1988, ISBN 0201539926.
      • Kernighan and Pike, Practice Of Programming, 1999, ISBN 978-0-201-61586-9.
      • Hunt and Thomas, The pragmatic programmer: From journeyman to master, 2000, ISBN 978-0-201-61622-4.
      • Sarwar, Koretsky, and Sarwar, Unix: the textbook, 2005, ISBN 032122731X.
    • Topics covered:
      • C programming
      • Programming practice
      • Linux/Unix Systems Basics
    • Topics covered in detail (page 6)
      • C basics (intro to variables, data types, arithmetic, expressions, branching, looping, functions, arrays, character strings, C structures, arrays of structures and pointers, pointer arithmetic)
      • Program memory
      • Bitwise operations, extended data types, and the C preprocessor
      • Larger programs and libraries
      • Dynamic memory allocation
      • Miscellaneous and advanced C features
      • I/O and system calls
      • Miscellaneous topics
      • Version control (Git)
      • Build tools (make)
      • Debugging (gdb)
      • Filesystem & processes
      • The Shell (bash)
      • Text editors and utilities
    • Learning objectives (page 11-12)
      • Write bug-free, moderately complex C programs
      • Explain fundamental concepts of pointers (memory addresses and pointer arithmetic)
      • Describe the representation and storage of C program variables and arrays in memory
      • Decompose a large program into cohesive, separately-compiled modules and manage compilation and linking of those modules
      • Build and use statically and dynamically linked libraries
      • Describe operating systems and the software build process and its automation
      • Effectively use version control Git to manage non-trivial program
      • Utilize common UNIX/Linux commands and combine them to solve complex problems
      • Describe fundamental concepts around UNIX processes and the filesystem
      • Write non-trivial shell (bash) scripts
    • Assignments (page 15)
      • 15% of final grade (5 equally-weighted moderate programming assignments)
      • Due dates are strict
      • Extensions are granted on a case-by-case basis.
    • Labs (page 16-17)
      • 10% of final grade (5 equally-weighted short exercises)
      • Submissions are due at the end of lab time
      • No late submissions accepted
    • Discussions
      • 5% of final grade (4 equally-weighted online discussions)
    • Quizzes
      • 5 equally-weighted in-class quizzes
      • One unexcused quiz is permitted
    • Lab exams. (page 21)
      • Lab Exam 1: 5%
      • Lab Exam 2: 10%
    • Midterm Exam (page 23)
    • Final Exam (page 24)
    • Grading breakdown (page 25)
    • Lab information (page 26)
    • Office hours (page 27-28)
    • Help desk (page 29)
    • Academic integrity and collaborative work (page 30-31)
    • Tips for success (page 32)
    • UNIX fundamentals (page 33)
    • Navigate the filesystem (page 36–37)
    • Commands, arguments, and options (page 38-39)
    • Building blocks (page 40)
    • The --help option and the man pages (Page 41)
    • Next Class (page 42)
    • Quiz 1 (page 43)
    • Reading for topic 1 (Linux filesystems, utilities, and the shell) (page 44)
    • The Unix filesystems (page 45 -46)
    • The Unix filesystems (page 47-48)
    • The working directory and paths (page 49-54)
    • The command line (or the "shell")
    • The --help option and the man pages
    • Standard input and output
    • Redirection
    • Output Redirection
    • Input Redirection
    • Pipelines
    • Pipes: An Example
    • Pipes: Another Example
    • BASH scripting
    • BASH scripting: Variables
    • BASH scripting: command-line arguments
    • BASH scripting: branching using if-else
    • BASH scripting: conditional operators
    • BASH scripting: while loop
    • Next Class (C and make)
    • Programming; Assembly Languages
    • Programming; Higher-Level Languages
    • Operating Systems
    • Compiling, linking, and loading
    • Compiling, linking, and loading
    • Compilation vs. interpretation
    • Programming Environment
    • First C Program
    • First C program
    • First C Program
    • Basic Data Types
      • int
      • float
      • double
      • char
      • _Bool
      • Type Qualifiers: long, short, unsigned
    • Variables
    • Variable Name Conventions
    • Arithmetic expressions
    • Operator precedence
    • The unary minus operator
    • The modulus operator
    • Next class
    • Arrays; Example
    • Initializing Arrays, example
    • Character strings
    • Multidimensional arrays
    • Initializing multidimensional arrays
    • Functions
      • Functions in C
      • Functions example
      • Arguments and local variables
      • Automatic and static variables, examples
      • Global variables
      • Functions calling functions
    • Functions & Arrays
      • passing Arrays to functions using the same syntax
      • Arrays of Structures
    • Git: Branches
    • Git: Merging Branches
    • Git: Remotes
    • Git: Rebase, Squash
    • Git: Referencing Commits
    • Git: Commit Commands
    • Other Git Branch Commands
    • Next week (Structures & Memory)
    • Low-level File I/O
      • Low-level I/O: open()
      • Low-level I/O: close()
      • Low-level I/O: read() / write()
      • Low-level I/O: lseek()
    • C Library overview
    • OpenSSH utilities; Bash Scripting
    • OpenSSH : security
    • OpenSSH: configuration files
    • The ssh (secure shell) utility
    • The ssh utility: port forwarding
    • The ssh utility: X11 forwarding
    • The scp utility
    • The scp utility
    • The scp utility
    • Tmux
    • The rsync utility
    • The rsync utility
    • Next week
    • Miscellaneous and advanced Bash tools, C, C preprocessor
    • Awk, Sed
    • Program portability
    • Macros

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Test your knowledge on the assessment structure of the C programming course. This quiz covers topics such as quiz contributions to the final grade, floating-point constants, and course material focus areas. Evaluate your understanding of essential programming concepts.

    More Like This

    Use Quizgecko on...
    Browser
    Browser