Top Banner
Programming Fundamentals TRIVUz Academy www.trivuzAcademy.com
42

Programming Fundamentals

Apr 12, 2017

Download

Education

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Programming Fundamentals

Programming Fundamentals

TRIVUz Academywww.trivuzAcademy.com

Page 2: Programming Fundamentals

Why Programming? What is Computer? What is Program? What is Programming?

Page 3: Programming Fundamentals

So, Program isSome instruction computer follow to do our task. And this sequence of instructions is called a program.

Page 4: Programming Fundamentals

And, Programming isThe process of writing programs is called programming.

Page 5: Programming Fundamentals

What is the PROCESS?

Continue…

Page 6: Programming Fundamentals

Follow the steps given below to become a successful programmer:

Define the problem: Examine the problem until you understand it thoroughly.

Outline the solution: Analyze the problem.

Page 7: Programming Fundamentals

Continue…Expand the outline of the solution into an algorithm:

Write a step-by-step procedure that leads to the solution.

Test the algorithm for correctness: Provide test data and try to work out the problem as the computer would. This is a critical step but one that programmers often forget.

Page 8: Programming Fundamentals

Continue…Convert the algorithm into a program: Translate the

instructions in the algorithm into a computer program using any programming language.

Document the program clearly: Describe each line of instruction or at least some important portions in the program. This will make the program easy to follow when accessed later for corrections or changes.

Page 9: Programming Fundamentals

Continue…Run the program: Instruct the computer to execute

the program. The process of running the program differs from language to language.

Debug the program: Make sure that the program runs correctly without any errors or bugs as they are called in computer terminology. Finding the errors and fixing them is called debugging. Don’t get depressed when bugs are found. Think of it as a way to learn.

Page 10: Programming Fundamentals

Programming Language?

Page 11: Programming Fundamentals

Prerequisite… ?

Almost nothing…

Page 12: Programming Fundamentals

Platform… ?Mac, Linux, Windows….

Any of them…

Page 13: Programming Fundamentals

How old are you?What is your educational Background?

I don’t care…

Page 14: Programming Fundamentals

So, Who Are You? You are currently a computer user who love to use computer.

And definitely you are a user of a program.

Page 15: Programming Fundamentals

You are going to be… The creator of the Program. You will be the Programmer.

Page 16: Programming Fundamentals

So again, What is programming? When we want a computer to perform a specific task,

such as generating a marks sheet or a salary slip, we have to create a sequence of instructions in a logical order that a computer can understand and interpret. This sequence of instructions is called a program. The process of writing programs is called programming.

Page 17: Programming Fundamentals

The task of programming involves a lot of effort and careful planning. Without this, the computer will produce erroneous results. The following steps should go into the planning of program:

Defining and analyzing the problem

Developing the solution logically using an algorithm

Page 18: Programming Fundamentals

Defining and analyzing the problem Before writing a program, we have to define exactly what

Data we need to provide (input) and

Information we want the program to produce (the output).

Once we know these, we can figure out how to develop the solution.

Page 19: Programming Fundamentals

Understanding INPUT

Suppose we want to write a program to work out the total and average of a student’s marks in five subjects, we would need to mention the marks in the five subjects as input.

Page 20: Programming Fundamentals

Understanding OUTPUTNext, we have to think of the output — the elements that should be displayed and those that should not. In the marks example, since the task is to prepare a marks sheet, the marks in all the five subjects, their total and average should be displayed on the screen.

Page 21: Programming Fundamentals

INPUTBangla = 60

English = 80

Math = 100

History = 70

Page 22: Programming Fundamentals

OUTPUTAverage : 77.5

Page 23: Programming Fundamentals

PROCESSING

Average = (Bangla + English + Math + History) / 4

Page 24: Programming Fundamentals

Lets write our very first program Get Inputs from the user

Save them somewhere

Use a math logic to process

Show the result / output.

Page 25: Programming Fundamentals

Getting INPUTSMake a user interface to collect INPUT from user

Page 26: Programming Fundamentals

Handling Inputsvar a = (input for bangla)

var b = (input for english)

var c = (input for math)

var d = (input for history)

Page 27: Programming Fundamentals

Processing & Outputvar average; // another variable

average = (a + b + c + d) / 4;

print average;

Page 28: Programming Fundamentals

OUTPUT Our program process the input and show this output.

Page 29: Programming Fundamentals

VARIABLE What is variable?

Variable Naming?

Page 30: Programming Fundamentals

Data Types

Page 31: Programming Fundamentals

Type, Length, Range

Page 32: Programming Fundamentals
Page 33: Programming Fundamentals

Lab - 1 Let’s try variable in PHP environment

Page 34: Programming Fundamentals

Input Interface

<form name="test" method="GET”>Name:<input type="text" name=”InputName" /><input type="submit" name="submit" value="Go" />

</form>

<html><head><title>Programming – 1</title></head><body>

</body></html>

Page 35: Programming Fundamentals

Programming Process<?php

if(isset($_GET['InputName'])) {

$name = $_GET['InputName'];echo $name ;

} else {// some other code or load form

}?>

Page 36: Programming Fundamentals

Another Input

<form name="test" method="GET”>Name:<input type="text" name=”num" /><input type="submit" name="submit" value="Go" />

</form>

<html><head><title>Programming – 2</title></head><body>

</body></html>

Page 37: Programming Fundamentals

Programming Process<?php

if(isset($_GET[’num'])) {

$number1 = $_GET[’num'];echo $number1;$sqr = $number1 * $number1;echo “<br /> “ . $sqr;

} else {// some other code or load form}

?>

Page 38: Programming Fundamentals

Make a Simple Calculator

<form name="test" method="GET”>Name:<input type="text" name=”num1" /><input type="text" name=”num2" /><input type="submit" name="submit" value=”Sum" />

</form>

<html><head><title>Programming – 3</title></head><body>

</body></html>

Page 39: Programming Fundamentals

Class Contents

Get all class contents & codes from our site

http://trivuzacademy.com/class-content.php

Page 40: Programming Fundamentals

Assignment Read some article regarding data types Read some article regarding numbers

Read some article proved by Academy

Write some article regarding all of these

Page 41: Programming Fundamentals

TRIVUz Academywww.trivuzAcademy.com

Q & A

Page 42: Programming Fundamentals

THANK YOU

MS Alam [email protected]