14
Introduction to Introduction to Programming Programming Lecture Note Lecture Note ± 1 Programming Fundamentals Programming Fundamentals

Introduction to Programming(L-1)

Embed Size (px)

Citation preview

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 1/14

Introduction toIntroduction to

ProgrammingProgramming

Lecture NoteLecture Note ±± 11

Programming FundamentalsProgramming Fundamentals

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 2/14

BasicsBasics

Computer Computer isis merelymerely aa devicedevice thatthat cancan performperform manymany

taskstasks correctlycorrectly andand efficientlyefficiently butbut hashas nono II..QQ..

SoSo toto solvesolve aa problemproblem withwith thethe helphelp of of aa computer computer wewe

mustmust givegive itit aa sequencesequence of of commands/instructionscommands/instructions toto

performperform certaincertain taskstasks withwith thethe helphelp of of itit..

Hence, we (the programmers) find a way to solve the

problem and represent that way using algorithm or flowchart. Then we convert the algorithm/flowchart

into a computer program

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 3/14

BasicsBasics

AnAn instructioninstruction isis aa singlesingle simplesimple command,command, ee..gg..

yy == xx ++ 55

check check whether whether xx isis greater greater thanthan 1010

AA computer computer programprogram isis aa sequencesequence of of instructionsinstructions

writtenwritten inin aa programmingprogramming languagelanguage

A programmingprogramming languagelanguage isis aa languagelanguage whichwhich isis

acceptableacceptable (e(e..gg.. BanglaBangla isis notnot acceptableacceptable toto ananEnglishman)Englishman) toto aa computer computer systemsystem ii..ee.. usingusing aa

programmingprogramming languagelanguage wewe cancan givegive aa computer computer 

differentdifferent instructionsinstructions

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 4/14

Types of Programming LanguagesTypes of Programming Languages

Machine Language.Machine Language.

Assembly Language.Assembly Language.

HighHigh--level Language.level Language.We shall concentrate only on machineWe shall concentrate only on machinelanguage and high level languagelanguage and high level language

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 5/14

Machine LanguageMachine Language A programming language, which can be directly

understood by a computer

It is normally written as strings of binary 1s and 0s(remember: computer can only understand binary

numbers) For example, the program to add two numbers and

store it in another number might look somethinglike the following:

10110011111001111001110000110100

A program written in machine language is stored inan exe file (having .exe extension)

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 6/14

High Level LanguageHigh Level Language A programming language, which can¶t be directly

understood by a computer but easilyunderstandable to human beings

For example, the instruction to store the value 5

into a container/storage in memory will besomething like:

X = 5

Here, X is the name of the container where we arestoring that value

E.g. of high level language: C,C++,Visual Basic(VB) etc.

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 7/14

ompiler Compiler  A high-level language program is translated

(converted) into equivalent machine languageprogram by a translator program which is calledthe compiler

Program written in high level language

Compiler 

Program written in machine language

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 8/14

Compiler Compiler  We shall learn VB language. The compiler that we

shall use for this purpose is Visual Studio 2005

Hence, to compile means to translate our VBprogram to an exe file

Program written in VB (test.vb)

Compile

Program written in machine language (test.exe)

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 9/14

We want to learn ASP.NET We want to learn ASP.NET then why we bother about VB? then why we bother about VB? 

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 10/14

Networking BasicsNetworking Basics Server: A Server is a computer program that

provides services used by other computerprograms. For example a web server serves upweb page upon request from a client

Client: A client is a computer program thataccesses a remote service on another computersystem, known as a server, via a network(collection of interconnected computers)

Network

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 11/14

Types of web pagesTypes of web pagesStaticDynamic

Static web page:

A static web page is a web page that always comprises the

same information in response to requests from all users. It

contains solely some UIs, no programming logic is

associated with the page. Such pages are generally

designed by solely HTML and has .html or .htm extension.

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 12/14

Dynamic web page A web page that is composed by a program running on the

web server based on the request from the client.

Programming logics are associated with such pages.

E.g. upon login, different users will see different

welcome messages. Such web pages may have .aspx, .jsp or .php

extension

We shall learn how to create such a dynamic web page

using ASP .NET technology (having .aspx extension)

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 13/14

ASP .NETASP .NETASP.NET is a technology using which wecan create a single generic / dynamic pagethat will be automatically modified by theserver according to the user input and the

programming logic inside the page

When we create a web page (test.aspx)using ASP.NET, a VB file is automaticallycreated for that page (test.aspx.vb) whichcontains the programming logic associatedwith that page.

That¶s why we need to learn VB

8/7/2019 Introduction to Programming(L-1)

http://slidepdf.com/reader/full/introduction-to-programmingl-1 14/14

ASP .NETASP .NET

.aspx file contains the design of the page and.aspx.vb file contains the relatedprogramming logic associated with differentcontrols (e.g. button, textbox etc.) in .aspx

file.