Computer Science 227 Introduction to Programming

advertisement
Computer Science 227
Introduction to Programming
Iowa State University
Lecture 1
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
1/1
Welcome to Computer Science 227.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
2/1
Computational Thinking
Think like a computer scientist.
Problem solving skills—Ability to think logically, algorithmically, and
recursively.
Ability to think in abstract terms.
Solve problems from other domains via computational thinking
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
3/1
Instructors
Pavan Aduri
Atanasoff 102, pavan@cs.iastate.edu
Office Hours TBA
MWF 1:10–2, Carver 101
Steve Kautz
Atanasoff B6, smkautz@iastate.edu
Office Hours TBA
MWF 9:00–9:50, Carver 305
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
4/1
Teaching Assistants
Cover labs
Hold office hours
Grading, etc.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
5/1
Lectures
We love to see you in lectures...
Attending lectures is optional.
This means only that there are no points assigned specifically to
attendance.
However, any material presented or announcements made in lecture
are your responsibility to know.
If you are having difficulty with material or struggling in the class, it is
strongly recommended that you attend all lectures and labs.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
6/1
If you choose to read newspaper, do homework in lecture, or sleep
thats fine. But please do not disturb the class.
Your grade will be based on homework and tests, not on attendance.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
7/1
Labs
Labs will be taken by the Teaching Assistants.
We will use the lab sessions to answer questions about homework
assignments, to return exams, to cover supplementary material, and
to answer questions about the computer systems.
Enrollments are limited to 20 students each to give each student
access to a workstation during the lab.
All labs in Pearson 0108.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
8/1
No Labs during the first week of classes.
Labs start from Monday 8/29.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
9/1
Each Lab:
Read some lab material. Re-enforcing concepts from lecture + new
topics.
Check points—Small programming excercise.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
10 / 1
Home Works
There will be 4–5 Homeworks (in addition to lab excercises)
Major Programming problems. You typically have 2–3 weeks to finish
them.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
11 / 1
Exams
2 mid term exams and a final exam.
First Midterm: Sep 29, 6:30–7:45pm
Second Midterm: Nov 10, 6:30–7:45pm.
Final Exam: TBA.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
12 / 1
Grades
Exam 1: 15%
Exam 2: 15%
Final Exam : 25%
Lab Exercises: 10%
Homeworks: 35 %
(Iowa State University)
90 and above A80 and above B70 and above C60 and above D-
Computer Science 227 Introduction to Programming
Lecture 1
13 / 1
Course Text Book
Big Java by Cay Horstmann, 4th edition
OR
Java Concepts by Cay Horstmann, 6th edition
Essentially identical for the first 15 chapters (which include everything
we cover in this course). Big Java includes 9 more chapters covering
a lot of extra stuff that could be interesting to read.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
14 / 1
Background
Having some prior programming experience helps, but not necessary.
High School Mathematics: Rational numbers, Complex numbers,
functions, polynomials, binary numbers, sets, matrices etc.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
15 / 1
Com S 104: Introduction to Computers
Instructor: Ming Hua
email: hming@iastate.edu
MW: 4:10–5:00pm
First Half: 8/22–10/14.
Second Half: 10/17–12/16.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
16 / 1
Academic Dishonesty
Each assignment is to be the product of your own intellectual effort.
Any student found guilty of academic dishonesty will receive an F
grade for the course.
Additionally, we will adhere to university policies regarding academic
dishonesty, which means that you may receive any of the penalties
described in the Policies and Practices section of the Student
Handbook under Academic Dishonesty.
ZERO TOLERANCE.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
17 / 1
Plagiarism: If you present the work of someone else as if it were your
own, you are guilty of plagiarism. Plagiarism is unethical at every
level of every profession.
Tendering information: If you make your assignment available for
someone else to copy, you are guilty of tendering information, which is
also considered to be a form of academic dishonesty.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
18 / 1
Seek help
If you are having trouble with material, please seek help immediately.
Instructors, Teaching Assistants, Blackboard Discussion boards...
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
19 / 1
Blackboard
Obtain your ISU network ID.
If you do not have ISU network ID, get one using the following web
address:
https://asw.iastate.edu/cgi-bin/acropolis/register
There is a link to Blackboard from the main ISU web page.
Use your ISU ID and Password to Login.
You will find Com S 227 (possibly some other courses).
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
20 / 1
Questions?
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
21 / 1
Program
A sequence of “Simple Instructions”.
Result of running/executing a program: “Perfom a Complex task”.
Program is like a recipe.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
22 / 1
A Recipe
Preheat oven to 350 degrees. Then place chicken pieces in a fairly large casserole dish.
Place all curry sauce ingredients in a food processor or blender. Process well. Pour the curry sauce over the chicken.
Add the chopped eggplant (if using), plus kaffir lime leaves/bay leaf and cinnamon stick, mixing everything into the
sauce. Cover and bake 45 minutes at 350 degrees.
Remove dish from oven. Add the bell pepper and tomato, stirring them into the sauce. Return curry to the oven for
15-20 minutes, or until both chicken and vegetables are well cooked.
Do a taste test, looking for a balance of flavors. If not salty or flavorful enough, add up to 1 Tbsp. more fish sauce. If
too salty, add more fresh lime juice. If too sour, add a little more brown sugar.
Ladle the curry into a large serving bowl. Sprinkle generously with fresh basil and coriander (cilantro), and serve with
plenty of Thai jasmine-scented rice. ENJOY!
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
23 / 1
Program – Adding numbers
Add digits in Zero’ Column
Is there a Carry?
Add digits in Tens’ column
Is there a carry?
···
···
Basic Instruction: Adding single digits.
Program for Multiplication?
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
24 / 1
Programs for Machines — Computer Programs
Computers can perform certain basic instructions.
A computer program is a sequence of basic instructions.
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
25 / 1
Toy Example
Toy Computer with Basic Instructions:
draw line – Draws a 5 inch line
turn right
turn left
erase line – Erases 3 inches of a previously drawn line
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
26 / 1
Toy Example
A program to draw a 5 × 5 square
draw line
turn right
draw line
turn right
draw line
turn right
draw line
How about a 10 × 10 Square?
How about a 9 × 9 square?
(Iowa State University)
Computer Science 227 Introduction to Programming
Lecture 1
27 / 1
Download