CSCI 103L - Fall 2024 Introduction to Programming

Unit 3 Exercises

Create a Github account

In order to use the in-class excercises, you must have an account on Github.com. If you have not created a Github account yet, follow the instructions in this section. If you already have a Github account and you wish to use it for this course, you can skip to the next section.

Github is a development ecosystem based around git. We will be using Github to authenticate your identity and you will also use it in CS 104 to store your code.

Start by visiting Github’s sign-up page. You are free to choose your username and does not necessarily need to match your USCNet account. Your email, however, should be your USC e-mail address.

https://github.com/signup/free

You will be sent an email to verify your email address. Verify your account before proceeding.

Setup your Github Account

Follow the instructions carefully on this page.

Here is a C++ scratchpad

cpp/scratch

Image Processing

C-Strings

Which of these do you think will compile?

char name[100] = "Dave";
char name[] = "Dave";
char name[5] = "Dave";
char name[4] = "Dave";
cpp/cstrings/strlen
cpp/cstrings/strcpy
cpp/cstrings/streq
cpp/cstrings/capitalize

Pointers

cpp/pointers/examples/ptrmath
cpp/pointers/swap
cpp/pointers/ret2
cpp/pointers/OneOrMany
cpp/pointers/product
cpp/pointers/roll2

Dynamic Memory

cpp/dynamic_mem/examples/return_stack
cpp/dynamic_mem/examples/bad_delete
cpp/dynamic_mem/examples/gone
cpp/dynamic_mem/examples/recycle
cpp/dynamic_mem/redelete
cpp/dynamic_mem/oom
cpp/dynamic_mem/examples/newarray
cpp/dynamic_mem/examples/rem_quo
cpp/dynamic_mem/ordered_array

Pointers to Pointers and Command Line Arguments

cpp/pointers/int-2D
cpp/pointers/cmdargs_ptr_ex
cpp/pointers/cmdargs_ptr_ex2
cpp/pointers/hello
cpp/pointers/divide
cpp/pointers/cmdargs_sum
cpp/pointers/cmdargs_smartsum
cpp/pointers/cmdargs_smartsum_str
cpp/pointers/toi

Deep vs. Shallow Copy & 2D Array Allocation

cpp/dynamic_mem/names
cpp/dynamic_mem/nxmboard

Structs

cpp/classes/examples/location_copy
cpp/classes/examples/location_eg
cpp/classes/location_eq
cpp/classes/location_reset

I/O Manipulators

cpp/var-expr/iomanip

C++ Strings

cpp/cppstrings/examples/stringeg
cpp/cppstrings/complement
cpp/cppstrings/palindrome
cpp/cppstrings/circ_shift
cpp/cppstrings/is_circ_shift

Classes

cpp/classes/clicker
cpp/classes/the_count
cpp/classes/combolock