level 3 computing year 2 lecturer: phil...

14
Level 3 Computing Year 2 Lecturer: Phil Smith

Upload: others

Post on 11-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Level 3 Computing

Year 2

Lecturer: Phil Smith

Page 2: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Introduction

This unit aims to enable you to develop the skills and understanding required to design and develop procedural programming applications.

Irrespective of framework or delivery platform, the development of procedural code is still at the core of many commercial applications development projects.

Event driven systems and object oriented platforms all use procedural code for the critical command content of their objects, events and listeners

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 3: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Introduction This unit spans the whole year.

1.5 hours per week.

Combined lecture and practical's.

3 assignments.

Assignment 1 around October 2014.

P1, P2, M1 and D1

Assignment 2 around January 2015.

P3, P4, M2

Assignment 3 around May 2015.

P5, P6, M3, M4, D2

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 4: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Learning Outcomes

1. Understand the features of procedural programming.

2. Be able to use the tools and techniques of a procedural language.

3. Be able to design procedural applications.

4. Be able to implement procedural applications.

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 5: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Procedural programming So what is procedural programming?

Procedural programming is a programming paradigm, derived from structured programming, based upon the concept of the procedure call. Procedures, also known as routines, subroutines, methods, or functions, simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program's execution, including by other procedures or itself. Procedural programming is a list or set of instructions telling a computer what to do step by step and how to perform from the first code to the second code. Procedural programming languages include C, Go, Fortran, Pascal, and BASIC.

http://en.wikipedia.org/wiki/Procedural_programming

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 6: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Procedural programmingThe most Popular Procedural programming language is

C.

We will be using VB.Net.

Procedural programming is used in event driven applications as well as in Object Oriented Programming (OOP).

In fact it is present in virtually all types of programs regardless of the programming language used to write the code.

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 7: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Tools and language We shall be using Visual studio 2015. (IDE).

We shall be using VB.net.

We shall be writing console and form based applications.

You used VS2010 and VB.net in Event driven programming last year.

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 8: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

IDE Refresher Designing a windows based form in VB.net.

Now do lab 1 (on the wiki).

Make sure you save your work.

Follow the instructions carefully.

There is no code in the Lab, we shall do this together in a tutor led tutorial.

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 9: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Procedural programming In procedural programing we list a set of steps which

have to be executed in that order to achieve something.

e.g.

step 1: Get Value1

step 2: Get Value2

step 3: Get Value3

step 4: Sum=Value1+Value2+Value3

step 5: Average=Sum/3

step 6: Display Average

Steps are completed in order

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 10: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Variables What is a variable?

In vb.net we define a variable like this –

Dim myVariable as datatype.

What is a data type?

What does Dim mean?

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 11: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Variable Data types All variables have a type –

e.g. String, Integer, Decimal, Float etc

These data types determine the type of data that can be placed into the variable and also defines the amount (size) of memory needed to store the data.

VB.Net provides a wide range of data types. The following table shows all the data types available:

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 12: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Variable Data types

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 13: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Variable Scope The scope of variables depends very much on where

you define them –

Variables are visible to the code when defined in the same code block.

Lets start to write some code for our Lab 1 project.

BTEC Level 3 Year 2 - Unit 16 Procedural Programming

Page 14: Level 3 Computing Year 2 Lecturer: Phil Smithwiki.computing.hct.ac.uk/_media/computing/btec/level3/unit16_lecture_01.pdf · Designing a windows based form in VB.net. Now do lab 1

Summary What have we learned today?

BTEC Level 3 Year 2 - Unit 16 Procedural Programming