Visual Programming by Muhammad Bilal Zafar (AP)

39
Visual Programming by Muhammad Bilal Zafar (AP)

description

Visual Programming by Muhammad Bilal Zafar (AP). COURSE INTRODUCTION. Visual Programming. Programming in which more than one dimensions is used to convey semantics. Diagrams, icons or demonstration of actions performed by graphical objects. - PowerPoint PPT Presentation

Transcript of Visual Programming by Muhammad Bilal Zafar (AP)

Page 1: Visual Programming by Muhammad  Bilal Zafar (AP)

Visual Programming

by

Muhammad Bilal Zafar (AP)

Page 2: Visual Programming by Muhammad  Bilal Zafar (AP)

COURSEINTRODUCTION

Page 3: Visual Programming by Muhammad  Bilal Zafar (AP)

3

Visual Programming

Programming in which more than one dimensions is used to convey semantics.

Diagrams, icons or demonstration of actions performed by graphical objects.

It is a methodology in which development allows programmers to grab and use of ingredients like menus, buttons, controls and other graphic elements from a tool box.

Page 4: Visual Programming by Muhammad  Bilal Zafar (AP)

4

Course Description

Introduces key skills of problem solving and visual computer programming, including the elementary programming concepts.

Covers the fundamentals & details of following

Visual language Iconic and symbolic representations Debugging techniques Semantics and pragmatics of desktop applications Web programming

Page 5: Visual Programming by Muhammad  Bilal Zafar (AP)

5

Course Description..

Flow of course would be like this

Fundamentals of OOP. Console based applications using Visual C++. CLR based programming using Visual C++. Desktop based applications using MFC and CLR.

and in the last part we will see

Visual ASP.NET for web based applications.

Page 6: Visual Programming by Muhammad  Bilal Zafar (AP)

6

On completion of this course students will have the ability to comprehend

Concepts of OOP

.NET Framework

Visual C++

ASP.net & C#

Course Objectives

Page 7: Visual Programming by Muhammad  Bilal Zafar (AP)

7

Comprehend a programming problem and design a solution.

Code a solution to a problem for both desktop and web based applications using visual tools.

Course Objectives..

Page 8: Visual Programming by Muhammad  Bilal Zafar (AP)

8

Recommended Books

IVOR HORTON’S BEGINNING VISUAL C++ 2010,by Ivor Horton

ASP.NET 4 24-HOUR TRAINER by Toe.B Right

Page 9: Visual Programming by Muhammad  Bilal Zafar (AP)

9

Reference Books / Readings

OBJECT-ORIENTED PROGRAMMING IN C++, 4th Edition by Robert Lefore

BEGINNING ASP.NET 4: IN C# AND VB by Imar Spaanjaars

For Online Library help http://msdn.microsoft.com/library/default.aspx

Page 10: Visual Programming by Muhammad  Bilal Zafar (AP)

10

Course Prerequisites The student is expected to somehow familiar with the

programming languages and operating systems concepts.

Page 11: Visual Programming by Muhammad  Bilal Zafar (AP)

11

Assessment & Grading

Exam No Exam Type Due after Lecture No. Total Marks

1 Quiz 1 5 5%

2 Quiz 2 22 5%

3 Assignment 1 10 10%

4 Assignment 2 26 10%

5 Midterm Exam 18 20%

6 Final Exam 32 50%

Marks scheme:

Quizzes + assignments = 30% Mid Term Exam = 20% Final = 50%

Page 12: Visual Programming by Muhammad  Bilal Zafar (AP)

LESSON 01

Page 13: Visual Programming by Muhammad  Bilal Zafar (AP)

13

Programming Languages

Programming language is an artificial language designed to communicate instructions to a machine, particularly a computer.

It can be used to create instruction sets (programs) that can control the behavior of a machine.

Page 14: Visual Programming by Muhammad  Bilal Zafar (AP)

14

Programming Languages..

Mainly PL has comprised of two components

Syntax

Semantic

Page 15: Visual Programming by Muhammad  Bilal Zafar (AP)

15

Syntax

Set of rules that defines the combinations of symbols that are considered to be correctly structured in that language.

Computer language syntax is generally distinguished into three levels:

Words Phrases Context

Page 16: Visual Programming by Muhammad  Bilal Zafar (AP)

16

Semantics

Semantics is the field concerned with the rigorous mathematical study of the meaning of programming languages.

It does so by evaluating the meaning of syntactically legal strings defined by a specific programming language.

Semantics describes the processes a computer follows when executing a program in programming language. 

Page 17: Visual Programming by Muhammad  Bilal Zafar (AP)

17

Programming Languages

Generally we can divide the programming languages into two main categories.

High Level Languages

Low Level Languages

Page 18: Visual Programming by Muhammad  Bilal Zafar (AP)

18

Types of Languages.. High Level Languages

A language that supports system development at a high level of Abstraction thereby freeing the developer from keeping lots of details that are irrelevant to the problem at hand.

Close to human language

Easy to write

Pascal, Fotran, C++, Java, Visual basic, PHP, PERL … etc…

i.e printf (“Hello World”);

Page 19: Visual Programming by Muhammad  Bilal Zafar (AP)

19

Types of Languages.. Low Level Languages

Low-level languages are designed to operate and handle the entire hardware and instructions set architecture of a computer directly. 

A programming language that provides little or no abstraction from a computer's instruction set architecture.

Generally this refers to either  Assembly language or Machine language.

Page 20: Visual Programming by Muhammad  Bilal Zafar (AP)

20

Types of Languages...

Assembly Language

An assembly language is a low-level programming language, in which there is a very strong correspondence between the language and the architecture’s machine code instructions.

Each assembly language is specific to a particular computer architecture

Use Symbolic operation code

MOVE  3000,4000  // Copy contents of location 3000 to location 4000

Page 21: Visual Programming by Muhammad  Bilal Zafar (AP)

21

Types of Languages...

Machine Language

Fundamental language of the computer processor

All programs are converted into machine language before they executed

Consists of combination of 1’s and 0’s that represent high and low electrical voltage

Page 22: Visual Programming by Muhammad  Bilal Zafar (AP)

22

Programming Types Programming can be done in different ways but in high level

languages there are two major approaches.

Structured Programming

Object Oriented Programming

Page 23: Visual Programming by Muhammad  Bilal Zafar (AP)

23

Structured Programming

Structured programming is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify. 

It is a technique that follows a top down design approach with block oriented structures.

Also known as Modular Programming.

Page 24: Visual Programming by Muhammad  Bilal Zafar (AP)

24

Object Oriented Programming

Object-oriented programming (OOP) is a programming language model organized around

Objects rather than actions&

Data rather than logic language syntax

Objects are usually instances of classes & are used to interact with one another to design applications and computer programs.

Page 25: Visual Programming by Muhammad  Bilal Zafar (AP)

25

Object Oriented Programming..

OOP organizes program around a real-world entity called an object (Instance).

Classes

A class is a construct that is used to define a distinct type

Attributes

Methods

Page 26: Visual Programming by Muhammad  Bilal Zafar (AP)

26

OOP..

Main characteristics of OOP

Encapsulation

A language mechanism for restricting access to some of the object's components

A language construct that facilitates the bundling of data with the methods (or other functions) operating on that data.

Page 27: Visual Programming by Muhammad  Bilal Zafar (AP)

27

OOP..

Inheritance

Inheritance is a way to establish a relationship between objects of the classes.

Polymorphism

It is the ability to create a variable, a function, or an object that has more than one form.

Page 28: Visual Programming by Muhammad  Bilal Zafar (AP)

28

C++

Developed by Bjarne Stroustrup starting in 1979 at Bell Labs.

C++ was originally named C with Classes.

The language was renamed C++ in 1983.

It is an intermediate-level language, as it comprises both high-level and low-level features.

C++ is an Object Oriented Programming Language.

However, It is possible to write object oriented or procedural code in the same program in C++.

Page 29: Visual Programming by Muhammad  Bilal Zafar (AP)

29

C++.. C++ application domain includes following areas

Systems Software

Applications Software

Device Drivers

Embedded Software

High-performance server and client applications

Video Games

Page 30: Visual Programming by Muhammad  Bilal Zafar (AP)

30

C++ Syntax

C++ Programs built from pieces called classes and functions

C++ standard library provides rich collections of existing classes and functions for all programmers to use.

Basic Syntax

Lets see an example program

Page 31: Visual Programming by Muhammad  Bilal Zafar (AP)

31

C++ Program

#include <iostream.h <

using namespace std ;

//Comments goes here .…

int main )(

{cout << "Hello World"; // prints Hello World

return 0 ;}

Page 32: Visual Programming by Muhammad  Bilal Zafar (AP)

32

Program Description

#include <iostream.h <

The C++ language defines several headers, which contain information that is either necessary or useful to your program.

using namespace std ;

It tells the compiler to use the std namespace.

Namespaces allow to group entities like classes, objects and functions under a name.

Page 33: Visual Programming by Muhammad  Bilal Zafar (AP)

33

Program Description..

//Comments goes here .…

It is a single-line comment available in C++. Single-line comments begin with // and stop at the end of the line

int main)(

This is the line where program execution begins. 

Main function with a return type integer.

Page 34: Visual Programming by Muhammad  Bilal Zafar (AP)

34

Program Description...

cout << "Hello World"; // prints Hello World

It causes the message “Hello World" to be displayed on the screen.

And its second part after // is a comment.

return 0;

This line terminates main( )function and causes it to return the value 0 to the calling process.

Page 35: Visual Programming by Muhammad  Bilal Zafar (AP)

35

C++ Keywords Some keywords are:

if else for switch int float char main class auto bool break case default return

CASE SENSITIVE LANGUAGE

Page 36: Visual Programming by Muhammad  Bilal Zafar (AP)

36

Execution Phases

Page 37: Visual Programming by Muhammad  Bilal Zafar (AP)

Where to Write the Code ????

Page 38: Visual Programming by Muhammad  Bilal Zafar (AP)

38

Code Editors Code can be written in any word processor that can create text files. Can also be written on command line.

Some code editors are

Notepad Edit pad lite Text wrangler (For Mac machines only) Jedit Vim Dream Weaver Net Beans

IDE ????

Page 39: Visual Programming by Muhammad  Bilal Zafar (AP)

39

Thank You