CSCI 103 - Spring 2024 Introduction to Programming

Unit 1 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

Variables and Expressions

cpp/var-expr/examples/maxplus
cpp/var-expr/4swap
cpp/var-expr/cout-basics
cpp/var-expr/hello
cpp/var-expr/examples/tacos
cpp/F14/printseconds
cpp/var-expr/char_arith
cpp/var-expr/math
cpp/var-expr/examples/funccall
cpp/var-expr/quadratic

Random Number Generation

cpp/random/examples/randcalls
cpp/random/examples/seed
cpp/random/examples/seedtime

Conditionals (if..else)

cpp/control/discount
cpp/control/compare2
cpp/control/weekday
cpp/control/letter_grade
cpp/control/nth

Loops 1

cpp/control/loop_example1
cpp/control/guessing
cpp/control/count_example
cpp/control/countodd
cpp/control/liebnizapprox
cpp/control/wallisapprox
cpp/while/sum50
cpp/for/sum-mult-2-5
cpp/while/turn360

Nested Loops

cpp/var-expr/iomanip
cpp/control/timestable
cpp/nestedloops/flag
cpp/control/checkerboard

Loop Idioms: Reduction

cpp/random/examples/randdigits
cpp/misc/badsum

Loop Idioms: Selection

cpp/control/isprime2
cpp/random/rand_min

Arrays

cpp/arrays/pow2
cpp/arrays/sorted
cpp/arrays/examples/arraybad
cpp/arrays/weekday
cpp/arrays/arrayprint
cpp/arrays/alphabet2
cpp/arrays/cipher

Arrays - Pratice

cpp/arrays/distinct
cpp/arrays/reverse
cpp/passing/reset_array
cpp/passing/swap_elements
cpp/passing/replace_first
cpp/arrays/mergearrays

Functions

cpp/functions/abs_func
cpp/functions/overload
cpp/functions/draw-square

Functions - Practice

cpp/functions/orderit
cpp/functions/examples/return2
cpp/functions/remove_factor
cpp/functions/vowels
cpp/functions/examples/reset_bad