CSC 201
Introduction to Computer Science
1
Day 1: Vocabulary
Definitions (1-4) of 100 for 1st exam
com·put·er /kəmˈpyo͞otər/ Noun
An electronic device for storing and processing data, typically in binary form, according to
instructions given to it in a variable program.
sci·ence /ˈsīəns/ Noun
The intellectual and practical activity encompassing the systematic study of the structure
and behavior of the physical and natural...
e·lec·tron·ic /ilekˈtränik/ Adjective
(of a device) Having, or operating with the aid of, many small components, esp.
microchips and transistors, that control and direct an electric current: "an electronic
calculator"
de·vice /diˈvīs/ Noun
A thing made or adapted for a particular purpose, esp. a piece of mechanical or electronic
equipment.
2
Seriously, What is a computer?
Is an abacus a computer?
Is a simple 4-function calculator a computer?
Is a telephone a computer?
Is your brain a computer?
Let’s go with: “a machine that stores and manipulates
information under the control of a changeable program”
3
Hardware &
Software
Software is that
“changeable
program”.
Hardware is the
physical machine
that runs it.
4
Architecture Diagram
Diagram credit:http://notesofdigitallogic.blogspot.com/2016/01/block-diagram-of-
computer-number-system_1.html 5
What is computer science?
“Computer science is no more about computers than
astronomy is about telescopes.”
-- Michael R. Fellows
Instead: What can be computed?
The study of processes that manipulate data…
Kind of like math, but we can actually build/run ideas.
Kind of like art, but the creativity flows from formal rules.
6
ALGORITHMIC THINKING
al·go·rithm:
a step-by-step procedure for solving a
problem or accomplishing some end
especially by a computer
7
Some fields of computer science
• Graphics
• Computer Vision
• Artificial Intelligence & Robotics
• Data Mining
• Natural Language Processing
• User Interfaces
• Programming Languages
...
8
Bureau of Labor Statistics
Projections 2019-2029
Software Developers, Quality Assurance Analysts, Testers
Bachelor’s Degree, 316 thousand new jobs
Increase of 22%, Median income of $110,140
Computer & Information Systems Managers
Bachelor’s Degree, 48 thousand new jobs
Increase of 10% Median income $151,150
Computer System Analysts
Bachelor’s Degree, 46 thousand new jobs
Increase of 7% Median income $93,730
9
What about programming?
Computer programming is the art of turning
processes and ideas we have in our minds into
software that a computer can run.
There are many languages…
10
Programming is like Legos…
11
12
13
Should you take this course?
If…
“I hate computers.”
“I don’t pay attention to details.”
Programming is fairly detail-oriented.
“I refuse to think logically.”
“I am very impatient, and don’t want to learn patience”
Coding/fixing code (debugging) requires great patience.
“I want to take an easy class.”
Learning to program is challenging,
but if you put forth the effort,
it is ultimately rewarding.
No.
14
Should you take this course?
If…
“I want free gourmet meals and to make lots of money
by working for Google.”
“League of Legends rocks hardcore!”
Probably not.
If…
“I like to solve problems.”
“I want to learn a fun, interesting, useful new skill.”
“Robots are going to take over the world. I want to
befriend them so that my life will be spared.”
Yes!
15
How to do well in this course
Keep up. Don’t fall behind.
The course material is cumulative.
Procrastination will eventually come around to bite you.
Utilize all of your resources
Come to class; engage your brain; read the text; do the prep
for quizzes; do the coding practice and programming projects;
come to class to do the labs; use group drop-in tutoring; use
individual tutoring; use Prof Mourya’s office hours
Did I mention, come to class!
If you don’t understand something, ask questions (especially “WHY?”).
Every question is an opportunity for you *and your
classmates* to learn.
Computers are neither magical nor mysterious. Everything can
be explained!
16
Beginning Python
https://thonny.org/
Interactive Mode in the “Shell”
>>> print(‘CSC 201 is Intro to Computer Science’)
>>>3 + 7
>>> name = input(‘What is your name? ‘)
>>> print(‘Hello’, name)
>>> age = input(‘How old are you? ‘)
17
Getting info from user
input function
syntax:
variable = input(‘ ‘)
Prompt: words describing what to enter
Entered value stored here
Ex:
course = input(‘What is your favorite course? ‘)
18
Getting info from user
Converts the entered value to an integer
input function
syntax:
variable = int(input(‘ ‘))
Prompt: words describing what to enter
Entered value stored here
Text uses “eval” instead of “int” in chapter 1
Ex:
age = int(input(‘How old are you? ‘))
19
Output to user
Print function
syntax
print( )
Output to user
print(‘When do we get to the exciting stuff?’)
Text printed just as you
see it.
print(name, ‘is’, age, ‘years old.’)
Text printed just as you see it.
Value stored in variable is printed.
20
Saving our code
Enter code into the Editor (“non-Shell”) window
Save it to a file (or module in Python lingo)
def main():
name = input(‘Enter your name: ‘)
print(‘Hello’, name)
main()
21
Repeating code--Loop
number of times to repeat
for i in range(5):
print(‘Python is great!’)
Indented code is repeated
22
Try this with me
Open Thonny from the desktop
Write a program to allow the user to enter how many
times to repeat a cheer and then use a for-loop to
repeat it.
Sample Execution:
How many times to repeat? 4
Go, team, go!
Go, team, go!
Go, team, go!
Go, team, go!
23
Demo Coding Practice
Checks your code immediately
Penalizes for each wrong submission
At end of assignment, don’t submit unless every
problem is correct.
The assignment will submit for you at the cut-off time.
24
Your turn….
With your partner, predict the result.
Type the expression in the Shell
Was your prediction correct?
Expression Prediction Actual
3+6
0.3 + 0.6
‘3’ + ‘6’
25