Professional Documents
Culture Documents
Fundamentals
Why Programming?
What is Computer?
What is Program?
What is Programming?
Program is
Some instruction computer
follow to do our task. And
this sequence of instructions
is called a program.
Programming is
The process of writing
programs is called
programming.
What is the
PROCESS?
Outline
problem.
Expand
Test
Convert
Document
Run
Debug
Programming
Language?
Prerequisite ?
Almost nothing
Platform ?
Mac, Linux, Windows.
Any of them
What is programming?
When
Defining
Developing
algorithm
Once we know these, we can figure out how to develop the solution.
Understanding INPUT
Suppose we want to write a program to
work out the total and average of a
students marks in five subjects, we
would need to mention the marks in
the five subjects as input.
Understanding OUTPUT
Next, 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.
INPUT
English = 60
Math = 80
History = 100
Filipino = 70
PROCESSING
Average = (English + Math + History +
Filipino) / 4
OUTPUT
Average : 77.5
Getting INPUTS
Make
user
English
Math
History
Filipino
Handling Inputs
var a = (input for english)
var b = (input for math)
var c = (input for history)
var d = (input for filipino)
print average;
OUTPUT
Our program process the input and show
this output.
VARIABLE
What is variable?
Variable Naming?
Data Types
Programming
Process
<?java
if(isset($_GET['InputName'])) {
$name = $_GET['InputName'];
echo $name ;
} else {
// some other code or load form
}
?>
Another Input
<html>
<head><title>Programming 2</title></head>
<body>
<form name="test" method="GET>
Name:
<input type="text" name=num" />
<input type="submit" name="submit" value="Go" />
</form>
</body></html>
Programming
Process
<?java
if(isset($_GET[num'])) {
$number1 = $_GET[num'];
echo $number1;
$sqr = $number1 * $number1;
echo <br /> . $sqr;
} else {
// some other code or load form
}
?>
Make a Simple
Calculator
<html>
<head><title>Programming 3</title></head>
<body>
<form name="test" method="GET>
Name:
<input type="text" name=num1" />
<input type="text" name=num2" />
<input type="submit" name="submit" value=Sum" />
</form>
</body></html>
Assignment
Read some article regarding data
types
THANK YOU