13
CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana @cs.nuim.ie )

CS001 Introduction to Programming Day 1 Sujana Jyothi ([email protected])[email protected]

Embed Size (px)

Citation preview

Page 1: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

CS001Introduction to Programming

Day 1

CS001Introduction to Programming

Day 1

Sujana Jyothi([email protected])

Page 2: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

2

What will you learn?

• Learn to understand programs• Use the Scratch interactive

development environment (IDE) - Labs

• Learn to solve problems• Understand what we mean by

algorithms

Page 3: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

3

Resources

• Resources

– Use the material from NUIM Moodle.

• Save your work

– on your flash drive– or email it to yourself

Page 4: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

4

Course StructureLectures/Labs• Monday

11:00-12:00: lecture• Tuesday

9:00-10:00: Lecture• Lab

Friday 11:00 – 13:00

Assignments• Marks out of 2 are given for each of two laboratory

sessions• Two 10 minute quizzes (to be taken during lectures) – 3

marks each.• Total 10 marks for “Introduction to Programming” class.

Attendance• record will be kept for all sessions for lectures and labs

Assessment• will be based on lab work, quizzes & attendance

Page 5: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

Computer Programming

Easy to UNDERSTANDINTERESTING to know

&Enjoyable

Page 6: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

Programming is simply telling a computer to do a task

Sequence of steps to be followed

Page 7: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

Pizza Dough Recipe (Requirements)1. Gather Ingredients2. Combine sugar (1tbs), salt (1tbs),

olive oil (1tbs), flour (1c) in mixing bowl

3. Turn on mixer4. Add 1/4 cup of flour5. If dough comes off the sides go to

step 6, otherwise go back to step 4

6. Knead 15 minutes7. Let rest for at least 45 minutes in

warm area

1 dough ball

Page 8: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

N-Pizza Dough Program• Gather Ingredients• Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) in mixing bowl

• Turn on mixer• Add N/4 cup of flour• If dough comes off the sides go

to step 6, otherwise go back to step 4

• Knead 15 minutes• Let rest for at least 45 minutes in

warm area

N dough balls

Page 9: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

N-Pizza Dough Program• Gather Ingredients• Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) in mixing bowl

• Turn on mixer• Add N/4 cup of flour• If dough comes off the sides go

to step 6, otherwise go back to step 4

• Knead 15 minutes• Let rest for at least 45 minutes in

warm area

Sequence of Statements

N dough balls

Page 10: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

N-Pizza Dough Program• Gather Ingredients• Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) in mixing bowl

• Turn on mixer• Add N/4 cup of flour• If dough comes off the sides go

to step 6, otherwise go back to step 4

• Knead 15 minutes• Let rest for at least 45 minutes in

warm area

N dough balls

Variable

Page 11: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

N-Pizza Dough - Program• Gather Ingredients• Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) in mixing bowl

• Turn on mixer• Add N/4 cup of flour• If dough comes off the sides go

to step 6, otherwise go back to step 4

• Knead 15 minutes• Let rest for at least 45 minutes in

warm area

Conditional

Page 12: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

N-Pizza Dough - Program• Gather Ingredients• Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) in mixing bowl

• Turn on mixer• Add N/4 cup of flour• If dough comes off the sides go

to step 6, otherwise go back to step 4

• Knead 15 minutes• Let rest for at least 45 minutes in

warm area

SubroutinesMini-programs

N dough balls

Page 13: CS001 Introduction to Programming Day 1 Sujana Jyothi (sujana@cs.nuim.ie)sujana@cs.nuim.ie

Tomorrow's Class

• More on Programming• More on Algorithms• Friday – lab using Scratch