a powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · my favourite is...

30
2015-2016

Upload: others

Post on 07-Apr-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

2015-2016

Page 2: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Introduction to Programming

Phil Smith

Page 3: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Learning outcomesOn successful completion of this unit you will:

1. Understand the principles of procedural programming. (Assignment 1)

2. Be able to design procedural programming solutions.(Assignment 1)

3. Be able to implement procedural programming solutions. (Assignment 2)

4. Be able to test procedural programming solutions. (Assignment 2)

More detail on the wiki.

Page 4: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Assessment - PassLets review the assessment criteria. (wiki)http://wiki.computing.hct.ac.uk/computing/procedural_programming

Pass criteria.

Page 5: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Assessment - Merit

Page 6: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Assessment - Distinction

Page 7: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Assignments 3 summative assignments

Each has a formative assignment with feedback.

Page 8: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Structure 1.5 hours of lectures – approx.

1.5 hour of tutorial/lab (approx.),

Lab work will mostly be in small groups.

Additional independent study.

Page 9: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Resources Lectures.

Books (in lab).

Books in LRC.

Internet, you have internet access.

Periodicals etc.

Page 10: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Environment Programming Language:

Python

Use Idle – no IDE (as such) and pycharm?

Why?

1. Easy to learn.

2. Quick to write.

3. No complicated IDE.

4. Able to cover all programming principles.

5. But! (see over)

Page 11: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Environment this unit is not about the language, this is just syntax.

It is about (learning outcomes again)

the principles of programming,

being able to design procedural programming solutions,

implement the solutions (writing the code – python),

test the solutions.

Python is good for procedural programming but it can also cater for OOP and EDP.

Page 12: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Environment Procedural programming is one of three programming

paradigms.

Can you name the other 2??

Page 13: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

EnvironmentOnce you learn the principles of programming you can then skin it with any language you like.

So this unit is much more than learning python! But we will need python to help us.

Page 14: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Schedule - Python Problem solving and programming The compilation process Data types and assignment statements User Input Simple selection constructs More complex selection constructs The switch statement While constructs The for statement Strings Text files in Python Arrays Two-dimensional arrays Modules GUI

Page 15: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

About me

More than 35 years working in industry and education within the computing world.

In my time I have learnt about a dozen different computer languages.

My favourite is probably in the Microsoft camp C#, Vb.

I also like php, javascript etc.

I very much like writing (not playing) computer games, when I can get the time.

My strength is computer software in all it’s guises.

Page 16: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

About you What are your computer experiences –

For example-

Any experience of computers, if so what?

Any experience of computer languages?

How recent?

What interests you?

Software, hardware, networking, everything?

Page 17: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Start

Let’s get started?

Page 18: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Problem solving and programming What do we mean by the term ‘computer program’?

The Concise Oxford Dictionary has the following definitions of the words ‘computer’ and ‘program’ :

Computer

automatic electronic apparatus for making calculations or controlling operations expressible in numerical or logical terms …

Program

series of (coded) instructions to control operation of a computer or other machine. …

Page 19: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Program

Computer programming is the art or and craft of producing a computer program to perform some task or process.

The ‘series of (coded) instructions’ we use ‘to control the operation of a computer’ is called a computer program.

When we produce a computer program we are communicating with the computer telling it what to do.

Page 20: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Program Computers can do such a wide variety of things

because they can be programmed.

This means that computers are not designed to do just one job, but to do any job that their programs tell them to do.

A program is a set of instructions that a computer follows to perform a task.

We use a computer programming language as a means of communication.

Page 21: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Examples Some examples of how we communicate with people

to perform some task or process.

Recipes.

Knitting patterns.

Flat pack instructions.

Giving verbal or written instructions to others

Page 22: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

And so …. Programs are commonly referred to as software.

Software is essential to a computer because it controls everything the computer does.

All of the software that we use to make our computers useful is created by individuals working as programmers or software developers. (could be you in the future?)

Page 23: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Examples Any questions yet?

Some computing definitions

Page 24: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Python Getting started with python.

So what editor do we use to write python code?

Is it an IDE?

Page 25: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Python basics What we need to know to get started.

We will use IDLE (python shell) to interactively enter python code (just to start with).

Python is case sensitive.

Python is a loosely type language.

Python is scripted (not managed code).

Use JIT compiling.

Python is good for procedural programming???

Page 26: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Python basics

Each high-level language has its own set of predefined words that the programmer must useto write a program. The words that make up a high-level programming language are knownas key wordsor reserved words. Each key word has a specific meaning, and cannot be usedfor any other purpose. Table 1-2 shows all of the Python key words

Page 27: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Worked tutorial Find and start IDLE on your PC.

Lets explore Python language fundamentals.

Page 28: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Lab01 Now do Lab01

Page 29: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

Independent study Handout - week 1

if week==1:

print(‘Do not forget the research handout’)

Page 30: A Powerpointwiki.computing.hct.ac.uk/_media/computing/hnd/hndu18_lecture01.pdf · My favourite is probably in the Microsoft camp C#, Vb. I also like php, javascript etc. I very much

What have we learnt today?

1. Fundamentals of python IDE!

2. Basis of procedural programming.