Lecture 01 Intro
Joseph Haugh
University of New Mexico
Textbooks
- Java: A Beginner’s Guide by Herbert Schildt
- You can access this book for free digitally as part of UNM libraries subscription to McGraw Hill
- On Campus
- Off Campus
Supported Integrated Developer Environment (IDE)
Java Development Kit (JDK)
Grading
- 30% projects
- 40% exams (10% per exam)
- 15% lab quizzes/assignments
- 15% lecture quizzes
Late Policy
- Assignments/quizzes will automatically be docked 15% per day they are late after the assigned due date.
Lecture/Lab Quizzes
- No makeups will be given
- Lowest 4 lecture quizzes will be dropped
- Lowest 2 lab quizzes will be dropped
Course Overview
- Foster a firm grasp of the fundamentals of programming
- Ability to solve problems with code
- Developing fluency in:
- Conditional control flow
- Looping
- Procedural programming
- Focuses on projects and exams
Start Of Your Journey
- This class goes faster than 105
- Better matches the pace of the rest of the degree
- There will be a lot of work
- But if you can keep up you will be setup to succeed
Hands On Class
- This class demands participation
- You must show up to lecture and lab regularly to keep up
- Almost every class we will have a quiz
- Make sure to bring your computer or phone in order to complete the quizzes
- We will also have some paper quizzes and exams
Prerequisites
- This class expects you to have already programmed in any language
- If you took 105 then you have seen Python
- If not that is okay but you should still be familiar with the following:
- Comments
- Variables
- If statements
- Loops
Prerequisites Quiz
- We will be having 2 prerequisite quizzes
- 1 today and 1 on Friday
- These will count as normal quizzes
- These are designed to allow us (and you) to assess where you are at coming into this class
- If you get below a 70 average on these 2 quizzes you will need to quickly catch up not to fall behind
- If you get below a 50 average then you need to do a lot of work now to catchup
Python As Pseudocode
- To start the class we will review these prerequisite topics
- We will use Python to do this as most of you already know it
- If you don’t know you should be able to learn it very quickly
Variables
- Variables store information
- This can be numbers, string, lists and more
- Variables can have their values changed as the program runs
x = 5 # x is 5
y = 6 + 3 # y is 9
z = y * 2 # z is 18
If Statements
- Allows a program to take branching paths
- If the condition is true then takes the first branch
- Otherwise checks the other branch conditions until it finds one which is true
- Or gets the the else at the end of the chain
- Does not have to have an else branch
x = 5
if x > 5: # If x is greater than 5
# Then do these statements
print("Greater than 5")
elif x == 5: # Else if x is equal to 5
# Then do these statements
print("Equal to 5")
else:
# Else do these statements
print("Less than 5")
Looping
- Allows a program to repeat a sequence of statements many times
- While loops repeat the body of the loop until the condition is false
- Loops can repeat as many times as they want
i = 0
while i < 5: # Loop until i is NOT less than 5
# While the condition holds do these statements
print(i)
i = i + 1
# Then check the condition again and repeat if necessary
Indentation
- In Python indentation matters
- Indentation is how many spaces/tabs precede a line of code
- In order for statements to be inside a given Python if statement or while loop they must be indented further than if/while
- For example:
x = 5
y = 6
if x < 5:
x = 7 # This line is inside the if
y = 8 # This line is not
print(x) # Prints 5
print(y) # Prints 8
Indentation
x = 0
y = 0
while x < 10:
x += 1 # This line is in the while loop
print(x) # And so is this one
print(y) # But this is not
Comments