Learner objectives for this lesson
Welcome to CptS 111! Please see the course website for the syllabus and information about the course. Now let's get started!
Computer science is the study of computers and computational systems, with a particular focus on algorithms and problem solving
- Data analytics
input()
hello
'hello'
print("CptS 111 is AWESOME!!!!!!!!!!!!!!!!!!!!!!!")
CptS 111 is AWESOME!!!!!!!!!!!!!!!!!!!!!!!
temperature = 33
100 + 50
150
if temperature > 50:
print("It is warm out")
x = 0
while x < 10:
print(x)
x = x + 1
0 1 2 3 4 5 6 7 8 9
All of the programs you have used are composed of combinations of these 6 types of computer instructions, that is amazing! Writing programs, or programming, is really breaking problems into smaller and smaller subtasks until the subtasks are simple enough to be solved using the basic instructions above. These subtasks are algorithms.
What is an algorithm? A sequence of instructions that solves a problem. More specifically, a sequence of instructions is an algorithm if it meets the following criteria:
Why are algorithms so important to computer science? If we can specify an algorithm...
Impossible to do these algorithms on this scale without computers: Google Inside Search In 60 seconds, 2,314,800 google searches!!
Algorithms are a sequence of instructions that solves a problem. Algorithms are everywhere!
Just like how we have many different natural languages for humans to talk to each other (e.g. English, Spanish, German, etc.), there are many different programming languages for humans to talk with computers (e.g. Python, C, C++, Java, etc.).
You may have heard of binary? It's a bunch of 0's and 1's. For fun, watch this Big Bang Theory clip which includes Howard talking in binary!
Programming languages are a medium between natural languages and binary; however, natural languages are often ambiguous and contain redundant information. For example, consider this text:
It deosn't mttaer in waht oredr the ltteers in a
word are, the iprmoatnt tihng is taht the frist and lsat ltteer are in the rghit pcale.
We humans can read this, despite the fact that 13 of the 27 words are misspelled.
As another example:
Clearly Alice and Betty don't have on the same dress. These two examples are important to keep in mind because writing code in a programming language is much more precise than natural language. Your computer is very literal and you need to pay attention to detail.
Example: Domain name system
Problem: Computers can't execute high-level programming languages Solution: They must be translated
When learning to program (or really any new skill), practice is essential. In this class, I will always make sure you have material to learn and practice programming. At the end of each lesson, I will have a section called TODO (slang for an action item you need "to do"). Since we haven't learned programming just yet, your first to do list will be a little different than future lists:
We dive into Python :D Also, starting with next class (and all future classes), bring your laptop!