close

Вход

Забыли?

вход по аккаунту

код для вставкиСкачать
CSE/Math 1560:
Introduction to Computing for
Mathematics and Statistics
Winter 2011
Suprakash Datta
[email protected]
Office: CSEB 3043
Phone: 416-736-2100 ext 77875
Course page: http://www.cse.yorku.ca/course/1560
3/17/2015
Math/CSE 1560, Winter 2011
1
Announcements
1. Midterm: Feb 28, 2:30-3:30 pm, in
class.
2. Please practice the sample
exercises before going to the labs.
3. Regular office hours during reading
week.
4. All solutions are on the web (class
web page or Moodle)
5. Grades to be posted soon.
3/17/2015
Math/CSE 1560, Winter 2011
2
Midterm
1.
2.
3.
4.
5.
55 min test – please arrive on time
Short and very short answers
No multiple choice
Closed book and notes
Will be long
3/17/2015
Math/CSE 1560, Winter 2011
3
Question types
1.
2.
3.
4.
5.
What does this procedure do?
Correct the code so that it does….
Write a procedure to do….
Write down pseudocode for….
How would you compute….
3/17/2015
Math/CSE 1560, Winter 2011
4
Syllabus
Everything we did including sets and lists
but not loops (while or for).
3/17/2015
Math/CSE 1560, Winter 2011
5
Last class
Lists, while loops
Next: Do-loops. Ch 4 in the textbook.
3/17/2015
Math/CSE 1560, Winter 2011
6
for-loops
Format:
for i from <expr> to <expr> do
<statements>
end do
Note: Use shift-enter to enter code on
multiple lines
3/17/2015
Math/CSE 1560, Winter 2011
7
for-loops - contd
Format:
for i from <expr> to <expr>
while <expr> do
<statements>
end do
3/17/2015
Math/CSE 1560, Winter 2011
8
Exercise
Write a procedure firstPrimes(n) that
prints the first n prime numbers.
Do not use ithprime() or nextprime().
3/17/2015
Math/CSE 1560, Winter 2011
9
1/--страниц
Пожаловаться на содержимое документа