0% found this document useful (0 votes)
28 views

SS2 Computer Third Term Note 1

Uploaded by

Sam Okebaram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

SS2 Computer Third Term Note 1

Uploaded by

Sam Okebaram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

SS2 THIRD TERM SCHEME OF WORK

TOPICS
1. Introduction to program development
i. Definition of program
ii. Characteristics of a good program
 Accuracy, readability, maintainability, efficiency, generality, clear to understand
by others.
iii. Precaution
 Do not rush, be stable, steady and patient during program writing, no step
skipping, follow order of execution, etc.
2. Program development steps
i. Steps involved in program development
 Program definition
 Program analysis
 Flowcharting
 Desk checking
 Program coding
 Program compilation
 Program testing/ debugging
 Program documentation
ii. Description of each of the stages above
iii. Examples of interpreted programs and compiled programs
3. Algorithm and flowchart
i. Definition of:
 Algorithm
 Flowchart
ii. Functions of algorithm
iii. Characteristics of algorithm
 Finiteness, effectiveness, unambiguous, etc.
4. Writing algorithm
i. Writing algorithm for:
 Computing average of a given set of numbers
ii. Evaluation of equation: Y= a(b-c)2/d+2
iii. Printing out the first 10 odd numbers, etc.
iv. Flowchart symbols
 1/o, process, decision, etc.
5. BASIC PROGRAMMING 2
i. Built-in functions:
 SQR(x), EXP(X), INT(X), SIN(X), ABS(X), RND(X), COS(X), TAN(X),
LOG(X).
ii. a, b2-4ac-2a, b, (x-y) (x-y), c, (a+b) +c/sin d, ex+y–sin(x+m), e, ¼ ac, etc.
6. BASIC PROGRAMMING OPERATION
i. Write BASIC program to:
 Find square root of numbers within a given range
 Find square root to round up an integer
 Find the cosine of known values
 Find the tangent of a given angle
 Plot sine wave curve, plot cosine curve.
7. Internet
i. Definition of internet
ii. Some basic terms: browse, browser, chat room, cybercafé, download, email, homepage,
HTML, HTTP, Internet service Provider(ISP), Upload, protocol, web-page, website, etc.
iii. Internet main browser
 Internet explorer
 Netscape navigator
 Opera mini
 Firefox, etc.
8. Internet feature and email service
i. Features in main browser window
 Title bar, menu bar, tool bar, address bar, etc.
ii. Internet services
 Email, Email discussion group, telnet, use net, FTP, WWW, etc.
iii. Definition of electronic mail
iv. Email services
 Sending/receiving email
 Chatting
9. Email services 2
I. Steps involved in opening mail box
II. Features in an email address, e.g. – www.maristbrothersfms.org
III. Difference b/w email and website address features: www.mristbrothersfms.org
[email protected]
v. Definition of chatting
 Steps involved in chatting.

Program Development
Computer programs are developed using various computer coding languages. Each part of the program is
developed and finally parts are combined.Programming languages- computers are only able to function
because of the programs that are developed for them. Programs are written in different types of languages,
but there are three that serve as a foundation for all programming;
1.Mechanical/Machine language- consists of only ones and zero’s and is the only language a computer
can understand directly. This type of language poses a huge problem to programmers, because it is
extremely hard to read and write which makes it very easy to make mistakes.
2.Assembly language- this is more widely used than machine language. It is easier to understand and
compose. It is basically a symbolic representation of machine language made easier so that it is more
convenient and user friendly for programmers. Assembly language is comprised of easily recognizable
codes that translate into machine language in a one to one ratio. For each assembly language code used,
one machine language code is translated.
3.High-level language- is the commonly used computer programming language. It consists of mainly
English words and phrases. HLLs is the easiest language to learn and use; along with being the easiest to
read and modify. While assembly language has a one- to- one ratio with machine language, high- level
language, does not. One instruction from HLLs can be easily modified for use on different computers
giving it a large advantage over other programming languages, because of its versatility.
Program development life cycle(PDLC)
When programmers build software applications they do not sit down and start writing codes, instead
they follow an organized plan or methodology, that breaks the process into a series of task. There are
many applications development methodologies, just as there are many programming languages. Their
different methodologies, however tend to variation of what is called the program development life cycle
(PDLC).
The (PDLC) is an outline of each of the steps used to build a software applications. Similarly to the way
(SDLC) guides the system analysts through development of information system, the (PDLC) is a tool
used to guide computer programmers through development of an application.Therefore, program
development cycle is a set of rules that programmers use in order to make sure that a program is
developed properly. PDLC consists of six steps:
1. Defining the problem (analyzing)- this includes what the real word problem is to be solved and
how a program can do this. This basically defines the problem in order to develop an appropriate
solution. At this time, an outline is made which defines the entire process, including the program
input, output, and processing components.
2. Designing the program- at this time, any problem found during the analysis are broken down, i.e.
such problems are broken down into small ones and deciding what the steps of the problems are.
The method and appropriate programming language are chosen during the programming
processes. Structured designs allow the problem to be broken down into sections called modules.
This can be done so that each routine performs a single task. The structured design is important,
because it turns the main routine into smaller ones which helps the programmers locate any
problem easily and stay organized.
3. Coding the program- this implies using a specific programming language to write the lines of the
program. Note; this lines of code are called listing, and are also known as source code.
4. Testing/debugging- this implies testing the program, finding and correcting errors (debugging),
until it is error free and contains enough safeguard to ensure the designed result.
Remark: an error in a program is known as bug and the process of finding bugs is known as
debugging. There are three types of errors; syntax, logic, and run time errors. Syntax errors are
problems with grammar (spelling, punctuations, and these are easier to find. Logic errors are
errors that make a program result incorrect, and this is much difficult to find. I.e. logic errors
prevent your program from doing what you intended to do. Run-time errors are errors that occurs
when your programs attempts an operation that is impossible to carry out, e.g. division by zero.

5. Run/execute(formalizing the solution) to run the program on computer, one should use a complier
program, which first compiles the program, and which translates the human code into binary
language.
6. Documenting and maintaining the program- to document is to put together all the materials that
have been generated through the PDLC process. All of the flowchart, messages, algorithms, lines
of codes, and the user manuals are part of this documentation.
Note; documentation here is of two types: internal and external documentations.
Internal documentation-is used by other programmers to help them know why you did something
a certain way or tell them how you wrote a program. Since many programmers work on teams, it
is very important to have good internal documentation, so that each programmer on the team can
understand each others work.
External documentation- includes users manual and anything that is not the actual code or is part
of the listing which includes materials that are placed on a website, such as FAQ, and help areas.
Remark; to maintain is to make sure that the program keeps running as it should and to do any
needed updating and fixing. Maintenance is the longest phase of the PDLC, because as users use
the program they will notice things that need to be fixed and updated. No matter how many
times you test a program to make sure that it will work as expected, it is only when it gets into the
hands of the actual end users that some of these errors show up. You will continue to find and
update the program until it reaches a point where the program has become redundant or too old.
At that time maintenance stops and the PDLC starts over again.
The program development cycle is in fact a cycle because any phase can lead to previous or next
step in the cycle. This normally happens only if an error is found. It is also referred to as a cycle,
because once it ends, it begins again.Besides the programmers, there are other people involved in
the stages of PDC. System analysts, designers, systems architects, coders and testers are also
involved in the cycle. They are all important when it comes to developing a successful program.
This cycle makes it easy when designing programs as well organized, since it can be an outline to
follow. Therefore, a program is a set of instructions written in a particular language which the
computer understands.

Characteristics of a good program


Every computer requires appropriate instruction set (programs) to perform the required task. The
quality of the processing depends upon the given instructions. If the instructions are improper, or
incorrect then it is obvious that the result will be superfluous.
Therefore, proper and correct instructions should be provided to the computer, so that it can
provide the desired output. Hence, a program should be developed in such a way that it ensures
proper functionality of the computer. In addition, a program should be written in such manner
that it is easier to understand the underling logic. A few important characteristics that a computer
program should possess are as follows:
1. Portability- this refers to the ability of an application to run on different platforms (operating a
system) with or without minimal changes. Due to rapid development in hardware(H/W) and
software(S/W), nowadays, platform change is a common phenomenon. Hence, if a program is
developed for a particular platform, then life span of the program is severally affected.
2. Readability- the program should be written in such a way that it makes other programmers or
users to follow the logic of the program without much effort
3. Efficiency/performance-Every program requires certain processing time and memory to process
the instructions and data. As you must have realized,processing power and memory are the most
precious resources of a computer. A program should be laid out in such a manner that it utilizes
the least amount of memory and processing time.
4. Maintainability-the ease with which a program can be modified by its present and future
developers in order to make improvements or customizations, fix bugs, and security holes, or
adapt to new environment.
5. Reliability- how often the results of a program on conceptual correctness of algorithms, and
minimizations or programming mistakes.Because user’s actual needs will change from time to
time,a program is said to be reliable if it works smoothly in every version,i.e,if it gives same
performance in all simple to complex conditions.
6. Robustness- how well a program anticipates problems not due to programmers error. This
includes situations such as incorrect, inappropriate, or corrupt data, unavailability of needed
resources, such as, memory, o/s service and network connections, and user error.
7. Usability- the ergonomics of a program, i.e. the ease with which a person can use the program for
its intended purpose, or in some unanticipated purpose.
8. Structural- to develop a program, the task must be broken down into a number of subtasks, these
subtasks are developed independently, and each subtask is able to perform the assigned job
without the help of any other subtask. If a program is developed structurally the program not only
becomes more readable, but the tasking and documentation processes are also easier.
9. Flexibility – A program should be flexible enough to handle most of the changes without having
to rewrite the entire program. Most programs are developed for a certain period and they require
modifications from time to time.For example in case of payroll management,as the time
progresses,some employees may leave the company,while some others may join.So the
application should be flexible enough to incorporate all the changes without having to reconstruct
the entire application.
10. Generality- apart from flexibility, the program should also be general. By generality we mean that
if a program is developed for a particular task, then it should also be used for all similar task of
same domain. For example if a program is developed for a particular organization then it should
suit all the other similar organization.
11. Documentation- this is one of the most important components of an application development.
Even if a program is developed following the best programming practices, it will be rendered
useless if the end user is not able to fully utilize the functionality of the application.A well-
documented application is also useful for other programmers ,because even in the absence of the
authors ,they can still understand it.

Readability of source codes


In computer programming, readability refers to the ease with which a human reader can
comprehend the purpose, control flow and operation of source code.It affects the aspect of quality
above including portability, usability, and most importantly maintainability.
Readability is important because programmers spend most of their time reading, trying to
understand and modify existing source codes. Unreadable code often leads to bugs,
insufficiencies and duplicated code. The following precaution will be taken when writing a
program
1. Do not rush, be stable, steady and patient when writing program.
2. Avoid step skipping
3. Follow order of execution
4. Fresh mind
Steps involved in program development
1. Problem definition (understanding the problem) here, the programmer needs to know exactly
what the program is required to do and normally works from a program specification. This
program specification is normally part of a “system specification”, which defines the whole
system, of which the program may only be a small part. For example, the program might just be
one of a suite of programs for use in a particular application. Broadly speaking, the program
specification will define the inputs, processing and the outputs required. A good program
specification will normally specify what processing is needed by giving the exact relationship
between outputs and the inputs from which they are derived rather than prescribing how the
program should be written
2. Planning the method of solution (problem analysis)-this depends on the extent of the tasks, the
problem preparation may be shared amongst many programmers. Such co-operation requires an
overall plan. Large programs may require each programmer to write a separate part of the
program. This separate parts are often called modules or segments. The modules may be
prepared and tested separately, then linked together to be tested as a whole, a process known as
integration.
3. By the use of suitable aids such as algorithms (pseudo code or flowchart)-modern approach to
programming recognizes the fact that complicated programs can be solved most easily, if they are
broken down into simpler, more manageable task in a step by step fashion. At each step the
problem is broken down further and consideration of details is put off as long as possible. This
general approach is known as top down programming by step wise refinement.
4. Desk checking-this is a way to confirm the logic of a computer programs algorithm, ensuring
there are no bugs or mistakes present. The process is done manually without computer
assistance.To perform a desk check, an analyst prints out a hard copy version of the computer
program and goes over it manually line by line.
5. Typing the instruction in a programming language (coding)- this may be regarded as the last step
in stepwise refinement. The instructions written in the algorithm are written in programming
languages.
6. Testing the program- once a program has to be subjected to various tests to check that it has been
written out and transcribed correctly, and does what is supposed to do, i.e. that it is correct. This
test invariably reveals errors, which have to been corrected. This may be quite a lengthy and
expensive process. Careful and thorough design in the early stages of programming will help to
minimize these errors. The later an error is discovered, the more the expensive and troublesome it
will be to eliminate it.
Remark it is a good practice to test each components of a program as it is produced as well as
testing the completed program. There are several stages of testing:
a. Unit testing- this involves testing the separate component as they are produced.
b. Integrations testing- implies testing the separate component as they are put together.
c. System testing- which involves testing the whole program once it is in the final form in which
it is to be used.
d. User acceptance test- which involves the user of the program ( possibly the customer) testing
the program to see that it is required.

Precautions in program development


1. Be patient, steady and stable.
2. Avoid step sleeping.
3. Follow order of execution.
4. Have fresh mind.
Translating programs
These are programs that transforms programming languages instructions into the language codes
understood by computers. They are essentially invisible to the user who use pre-written applications
programs. Examples are interpreters and compilers.
Compiler
Remark, a compiler is a program that reads the entire source code at once, and generates machine code.
The most common reason for wanting to translate source code is to create an executable program.
A program that translates from low-level-language to high-level language is tagged a decompiler. A
program that translates HLLs is called a translator, source codes to source translator, or language
converter, while language rewriter is usually a program that translates the form of expressions without a
change of language. Examples of compiled languages are: C, C++, Algol, Java, Pascal, Visual basic.net,
etc.
Interpreter
This is a system program that reads the source code line by line and generates machine code. Examples
are: LOGO, BASIC, ASP, COBOL, etc.
Note; that interpreters and compilers are implementations of language, not languages themselves.

Interpreter versus compiler


It takes longer to run a program under an interpreter than to run the compiled code, but it can take less
time to interpret it than the total time required to run it. Also interpreting code is slower than running the
compiled code because the interpreter must analyze each statement in the program each time it is
executed and then performs the desired actions, whereas the compiler code just performs the action.
Examples of interpreted program(BASIC)
a.
FOR N= 1 to 200
PRINT N
NEXT N;
END

b.
A=6
B=3
C=5
AVG = (A+B+C) /3
PRINT “ AVG is”; AVG
END

Examples of compile program (PASCAL)


a. Program e.g (input, output);
VAR N: Integer;
BEGIN
For a = I to 200 do
BEGIN
WRITELN (‘value of a:’ , a);
A := a+1;
Readln (n);
End;
end.

b. Program e.g. (input, output);


VAR A, B, C: integer;
BEGIN
A: =6;
B: =3;
C: =5;

BEGIN
WRITE ((A+B +C )/3);
READLN (a, b, c);
END;
END.

Program displayname;
Begin
Writeln(‘Charles’);
Readln;
End.

Algorithms- when we solve problems, complicated operations are reduced to smaller steps. Such steps
give specific instructions for the solution of a particular problem. The Instructions follow one after the
other, and a scheme of these instructions is known as algorithm.
An algorithm can be used by any programmer to help him or herself to write the actual program using any
programming language. Each step of your algorithm, will be directly translated into a line of code when it
is time, the program is to be written using programming language, that is, one line of algorithm is equal to
one line of code. They are written in sequential order of action and are language on specific. If an
algorithm is written correctly, any programmer using any programming language could directly translate
each line of the algorithm into a line code, and if the algorithm is correctly written, the programmer
knows that the program will work. It is possible to desk check the algorithm, it saves a programmer a lot
of time to use an algorithm and trace it to make sure that the program will be correct, rather than just
sitting down at the computer and writing out the programs using the programming language.
Therefore, an algorithm is a logical sequence of steps that solves a particular problem. There are different
ways of presenting the sequence of operations or activities (algorithm), they are:
1. Pseudo-code
2. Flowchart
Pseudo- code is a representation of program logic in ordinary language. It is an outline in which the
program is written, without adhering to the rules of the programming language.
The emphasis is on logical flow of the program and ordinary language is used to represent the main
functions or in the program. Pseudo-code is incomplete and limited, but it is very useful, because it can be
used to communicate the essence of a program without being bugged down in precise details.
Example 1: prepare the algorithm (pseudo-code) that describes the steps on how to buy an envelope.
Solution
Step 1- enter the supermarket
,, 2 -go to the stationary department
,, 3 –look for envelopes
,, 4 –select the right size
,, 5 –pay
,, 6 – leave supermarket

Example 2: describe an algorithm (pseudo-code) for forming the equation: “twice a number, plus five,
equals six times the number minus three.
Solution
Step 1- choose y to represent the number
Step 2 -workout 2y
Step 3 -workout 2y+5
,, 4 -workout 6y
,, 5 -workout 6y-3
,, 6 -equate 2y+5 and 6y-3

Example 3- describe an algorithm (pseudo-code) that the computes the average of a given set of number.
Solution
Step 1- initialize sum, count
2- read score
3- let sum= sum + score
4- let count = count + 1
5- evaluate count
6- calculate average
7- end

Example 4: write an algorithm (pseudo-code) that evaluates the equation y= a(b-c)2/d+2

Solution
Step 1 –initialize the variables
2 –read the variables
3 –workout y
4 -workout f = (b-c)2
5 –workout the square of f
6 –workout k= f by a
7 –workout g = d+ 2
8 –divide k by g
9 –get the value of y
10 –print y
11 –end
Example 5: write an algorithm(Pseudo-code) to find the first ten odd numbers
Solution
Step 1 –let n= 1
,, 2 –print n
,, 3 –let count c=1
,, 4 –add 2 to n
,, 5 –add 1 to c
,, 6 –print n
,, 7 –is c <=10 go to step 4
,, 8 –end

Flowchart- this is a graphical representation of an algorithm. As the name suggests, a flowchart identifies
the program steps and uses connecting lines with arrows to indicate the flow or sequence of the program
steps.
Flowchart are drawn to represent the main logical steps in a program. It would be too time consuming and
unnecessary to draw flowcharting symbols for every statement in a program. The purpose of the flowchart
is to outline the major logical steps in a program and to indicate how they relate to one another in terms of
the sequence of program execution. Flowcharts are easier to learn than the regular programming
language.Moreover,it helps to identify the required steps to accomplish a particular task. There are two
types of flowcharts,namely: System flowchart and program flowchart.
System flowchart – is a diagram that describes how the entire system operates,i.e,it helps to recognize the
flow of operations in the system.it also helps in preparing the required documents of the
system.Furthermore,a system flowchart reflects the relationship between inputs,outputs and processes.
Managers ,business analysts,and software Engineers use system flowchart to analyze and design the
system.
Program flowchart – describes a single program.Before writing a complex program,it is a good practice to
draw a flowchart and identify how to solve the task using a program.Remark:System flowchart is more
difficult to understand than the program flowchart.
The symbol used in flowcharting a program logic are as follows

END/START/BEGIN/STOP
1.Terminal- the oval represents any terminal point in a program and generally contains words such as
START, END,etc
2.

INPUT/OUTPUT/READ/WRITE/PRINT/DISPLAY/ENTRY

Input or output- the parallelogram represents the input (via keyboard) or output ( to screen) function.
3
PROCESS

Process -the rectangle represents the processing operation e.g. a= x + y.


4

Flow directions-lines or arrows represent the flow direction function -the flow of control. It represents
logical flow of program.

5 ………. Annotation
Annotation- a broken line and a bracket represent the annotation. It represents a comment or notes in a
program.

6 Decision symbol
C
Decision symbol- the diagonal represent a decision.It represents logical command, such as if-else-end if.
Connector
7

Connector- the circle represents a function in a flow line.

8
Pre-defined connector

Pre-defined process –the double sided rectangle represents a named process, such as a module or function
or subroutine.
Statements required to describe algorithm
1.SEQUENCE-the algorithm is written in sequential steps, i.e. step 1 … stepn, within BEGIN and END
structure
2.Compound statement – i.e. a construct that allows the grouping of several statements together, so that
they can be handled as if they were one statement by enclosing them in brackets.
3.Assignment-i.e. ability to assign a value to quantity
4.Selection-the process of choosing the right statements to make the programing easier, smoother, faster
and bug free. A program can give the desired outputs in a number of ways, but the best and the most
efficient way should be chosen.
5.Repeation- i.e. a program may require repeating one step or a number of sequential steps to get the
desired output or may not require any repeation at all.Repeation can be of two types;
a.Iteration- one repeation of a statement or one occurrence of an event.
b.Looping- looping is referred to as the repeatition of a definite number of steps for a given number of
times. There are two types of loops:
i.Fixed loop- where the operations are repeated a fixed number of times. In this case, the values of the
variables inside the loop have no effect on the number of times. In this case, the values of the variables
inside the loop have no effect on the number of times that the looping operation is performed.
Ii. Variable loop- where the operations are repeated until a specific condition is met, here the number of
times that the loop is repeated may vary.

Use of flowchart symbols


Example 1: This algorithm (flowchart) describes steps on how to buy an envelope

C
L
G
P
Start
eao
ay
vt Enter supermarket
eo Enter the supermarket
Go to stationary dept.
End
ts
t
h
ea
t
NO
si
o
u
n
p Look for envelope
Yes
ea
r
y
m
a Leave supermarket
rd Is this the
Example 2: Prepare a flowchart to read a student’s score on six tests, add the scores together, compute the
average ke right
score, andsize?
print it. Start
e
p
t B
.
Sum = 0
AVG = Sum/Count
Count = 0
Read score
Write/Display/print Avg

Sum = Sum + Score END

Count = Count + 1

Is

Count
= 6 yes

Functions of algorithm
a. It is used as a step towards solving a particular problem.
b. It is also a step in developing a computer program.
c. It helps the sub-sequent programmer to modify the program.
d. It gives the programmer working knowledge of the program.
e. It is also used to explain the complex structure of the program.
Characteristics of an algorithm
1. Finiteness: This does not refer to the fact that an algorithm is a finite list of operations, it means
that an algorithm must always terminate in a finite number of steps, including repeations.
2. Definiteness: means that every step of the algorithm must be precisely and unambiguously
defined.
3. Effectiveness: means that every step can be carried out, and in a finite amount of time for
example, statements like get all data necessary to complete this problem is finite and definite, but
if the data are not available, it is ineffective.
4. Input: means that valid inputs are clearly specified.
5. Output: implies that it can be proved to produce the correct output given a valid input.

Basic programming 2
Built-in-functions- by definitions, a function is a sub program designed to perform a specific task and
return a value in QBASIC, there are two types of functions: standard or built-in function and user defined
function. Standard or built-in function are provided by the QBASIC system environment and basically all
the programmer needs is to use them, so he or she does not have to write codes to handle certain
situations.
A user defined function is written and specified by the programmer to accomplish a particular task, and
they always return one value to the “calling module”. Elements of user defined functions are: function
declaration,function call,and function definition.
a.Function call – The program that calls the function is referred to as the calling program or calling
functions.
b.Function definition – is an independent program module that is specially written or implement the
requirements of the function.
c.Function declaration – implies that the calling program should declare any function that is to be used
later in the program.
Standard function- as previously mentioned, standard functions are provided by QBASIC and simply
have to be called upon for use. The actual functions will have a particular name followed by parenthesis.
An argument is “passed” to the function by a inserting a constant, variable, expression, or another
function inside the parenthesis. The argument is what the function will be operating on. A function has
highest priority in a statement, so therefore, it will be evaluated before anything else in the statement.
The following is a list of “built-in” numeric function and their capabilities.
1.SQR(x) -return square root of a positive number. Example: SQR(9) is 3, SQR(0) is 0, SQR(2) is
1.414214.
2.INT(X) –returns the largest number less than or equal to a number. Therefore, INT discards the decimal
part of positive numbers. Example: INT (2.7) is 2, INT(0) is 0, INT(-2.7) is -3.
Note; the terms inside the parenthesis can be numbers, variables, or expressions. Expressions are
evaluated first to produce the input. Example A: the following program evaluates each of the functions
above as a variable.
REM: to evaluate function as a variable.
CLS
Let N= 62.5
Print SQR (N); INT (N)
END

Example B: the program evaluates each of the functions above as an expression.


CLS
Let a = 6
Let b = 3
PRINT SQR (5*b+2); INT (A^B)
END
3.ABS function (absolute function)- is used to find the absolute value of a number. Absolute value of a
number means that the number itself without any sign. The general form is ABS(x). Example: ABS (+3.4)
= 3.4, ABS(-3.4) = 3.4
4.RND function (random function)- RND is a special function that gives us a random number between 0
and 1. This can be used in games to make things interesting. RND is perfect for rolling dice or flipping a
coin.
Example: CLS
PRINT RND
PRINT RND
This program will print RND twice. Remark that you will get two numbers that appear to be
unpredictable and random. But when you run the program again, you will get the same “random
numbers”. This means your games would always be the same each time the user runs them.

Basic trigonometric functions: Cos(X)-


5.Cosine, sin(X),- SINE, TAN(X)- Tangent, ATN(X), (arctangent, inverse of TAN).
Example I:
A=30
PRINT Cos (A * 0.0174532)
END

Example II:
B =60
PRINT TAN (B * 0.0174532)
END

Example III: PI =3.141593


PRINT SIN (PI)
END

Example IV: PI = 3.141593


PRINT ATN (PI)
END

6.MOD function- means remainder, I.e. MOD function returns the remainder. Note, when a number is
completely divisible by the other, its MOD is zero. The general form is X MOD Y. Example: 16 MOD 5
=1, 30 MOD 10 =0
7.CINT function- means integer conversion. The function is used to convert number into integer, it rounds
a number to the nearest integer value. Syntax CINT (X). example CINT (15.46)= 15, CINT (-15.56) =-16,
CINT (15.56) =16
Comparing the above with INT functions gives INT (15.46) =15, INT (15.46) =-16, INT (15.56) =15,
INT (15.56) =-16.
8.SGN function- means sign, and returns the sign of the input number in numeric value. Syntax is
SGN(X). Example: SGN(X) =1, if x is positive, SGN(X)= -1, if x is negative, SGN(0)=0, if x is zero.
9.FIX function- fixes the fractional part of the number. This function translates the number into an integer.
Syntax: fix (x). Examples fix (15.46)=15, fix(15.56)=15, fix(=15.56)= -15.
10.EXP function – used to calculate the exponential function, i.e. raise e to some power, where value of e
is 2.13. Syntax Exe(X). Example: Exp(4) = 54.59815, Exp (5.46) =235.0974, Exp (-5)=6.737947E-03,
Exp(-5.56)=3.848777E-03.
11.LOG function- gives the natural logarithm of x. x>= 0. syntax log(X).
Basis Notations
a. b2-4ac → SQR((B^2)-(4*c))/2*A
2a
b. (x-y)/(x+y) → (x-y)/(x+y)
c. ex2+y-sin(x+NY) →Exp(x^2+y) SIN(X+N*Y).
d. B= 1/4AC → B= 1/(4*a*c)
Sample basic programs
1.REM: this program finds the square of a number b/w 1 to 10
CLS
PRINT N
FOR N = 1 to 10
PRINT SQR (N)
NEXT N
END
2.REM: this program finds the square of a number and round it up to an integer
CLS
INPUT N
PRINT INT (SQR (N))
END

3.REM: this program prints the cosine of any given angle

CLS
INPUT (N)
PRINT COS (N)
END
4.REM: this programs finds the target of any given angle
CLS
INPUT (x)
PRINT TAN (x)
END
5.REM: this program plots sine curve
REM :PRINT (SIN (dg%*0.017453)*50) +50(conversion)
CLS
SCREEN 13
FOR x%= 0 to 360
PSET (x%,(SIN(x%*0.017453)*50)+50)
NEXT X%
END

REM:This program plots cousine curve


CLS
SCREEN 13
FOR X% = 0 T0 360
PSET (X%,(COS(X% * 0.017453)*50)+50)
NEXT X%
END
REMARK: SIN command requires the input in Radians, so we can convert degrees to radians by
multiplying the degrees by 0.017453. So to get the y position of the sine wave at 90 degrees, we use (print
SIN (90*0.017453). PSET- is used to display the point coordinates (X,Y).
Uses of Functions:
a.They are very much useful when a block of statements has to be written/executed again and again.
b.They are useful when program size are too large and complex.
c.It works like top-down modular programming technique to solve problems.
d.They are also used to reduce the difficulties during debugging a program.
Definition of internet- internet is a global network of computers which provides a variety of resources and
data to the people who use it. The resources and data or services provided by the internet are enormous,
but the most well-known are email and World Wide Web (www).
E-mailis a system for transmitting messages between computers, while the World Wide Web is a global
system of linked web pages containing links to information or content. Information sharing and
communication are the primary purpose of the internet.
Uses of the internet- knowledge gain, research about a particular topic, sharing of information, chatting
and collaborations, e-commerce/airline, train booking, and buying and selling. Internet services are www,
e-mail, information sharing, chatting, conferencing etc. Note;
ARPANT- the experimental network tested in the 1970s, which started the development of the internet.
Email is a method of exchanging digital messages from an author to one or more recipients.

Some basic terms


1.Browse- is the term used to describe the user’s movement across the web, moving from one page to
another via hyperlinks, using a web browser.
2.Browser or internet browser- is a software application that enables one to browse the www, locating and
accessing web pages. Browsers translate HTML (hypertext make up language) code, allowing one to read
text, view images, play videos and listen to audio clips on websites. They also interpret hyperlinks that
allow to travel to different webpages when clicked on. While internet browsers are primarily intended to
access the internet, they can also be used to access private information on web servers or through file
system.
Types of internet browsers are: Mozilla Firefox, Netscape, Navigator, Internet Explorer, Operamini,
Google Chrome, Safari, etc.
Note; not all internet browsers are created equal. The three things to consider when choosing internet
browser are: simplicity, speed, and security: excelling in each of these areas are Google Chrome, Firefox,
and internet Explorer are among the current best internet browsers. The best internet browsers are
evaluated using the following criteria:
a.Feature set- i.e. a browser should provide practical, convenient features that make surfing the web easy
and fast. For example, a browser should offer tabbed browsing, a customizable toolbar and an integrated
search engine.
b.Security- While online security measures have a long way, since the inception of the internet, the web is
still rife with security risks, namely small scale dat. Security features, such as privacy setting, a pop-up
blocker, and antispyware, enable safe internet surfing and helps keep personal information, such as
password secure.
c.Speed and compatibility-i.e. web browser should load quickly and be compatible with all major o/s. a
top browser will load and navigate b/w pages within host a few seconds.
d.Ease of use-the best internet browsers are those that strive a seamless balance software features and ease
of use. While features on a web browser are important, they become worthless if a browsers interface
hinders your ability to utilize them. Web browsers interface hinders your ability to utilize them. Web
browsers should boast an interactive layout that fosters easy and convenient navigator.
e.Help and support- Although some internet browsers are open source and therefore not supplemented
with dedicated technical support. We still consider the quality of support options available. When it
comes to internet browsers, available support can come in many forms, ranging from FAQs to technical,
email support to a product manual.
FEATURES OF WEB BROWSER
Note, all major web browsers allow the user to open multiple information resources at the same time,
either in different browser windows or in different tabs of the same window. Major web browsers also
include pop-up blocks to prevent unwanted windows from “popping up” without the user’s consent.
Most web browser can display a list of webpages that the user has bookmarked so that the user can
quickly return to them.
Functions of a web browser
The primary purpose of a web browser is to bring information resources to the user. This process begins
when the user inputs of uniform recourse locator (URL), i.e. http:// mtn.org into the browser
Browsers users interface
Most major web browser have the following user interface in common
1.Back and forward button to go back to previous resource and forward respectively.
2.A refresh or reload button to reload the document resource.
3.A stop button to cancel loading the resources. In some browser, the stop button is merged with the
reload button.
4.A home button to return to users home homepage
5.An address bar to input terms into the uniform resours identifier (URI) of the desired resources and
display it.
6.A search bar to input terms into a search engine. In some browsers, the search bar is merged with the
address bar.
7.A status bar to display progress in loading the resource and also the URL of links when the cursor
hovers them, and page zooming capability.

Privacy and security- most web browsers support HTTP secure and offer quick and easy ways to delete
the web cache, cookies, and browsing history.
3.Chat room- is a website, or part of a website, or part of an online service, such as American online
(AOL), that provides an avenue for communities of users with a common interest to communicate in real
time.
4.Cyber café-an internet café or cyber café is a place which provides internet access to the public, usually
for a fee. They usually provide snacks and drinks, and the fee for using the computer is usually charged at
a time based rate.
5.Cyber space- it is the electronic medium of computer networks, in which online communication takes
place. Online systems for example, creates a cyber space, within which people can communicate with one
another (via email), do research, or simply window shop.
6.Download- simply means to transfer a file from remote computer to a local computer, or to transfer a
file from a web server to a web client. Example of a remote system from which a download might be
performed, include a web server, FTP server, email server, or other similar system.
7.E-mail- is a system for transmitting messages between computers.
8.Home page – simply means the first page that link/ site take you to, or the top – level ( main page) of a
website, i.e. the default page displayed when you visit a webpage.
9.HTML (Hypertext markup language) – is the language of web. It is a set of tags that are used to define
the content layout and the formatting of the web document. Note; web browser use HTML tags to identify
the different parts of a document so that a web browser will know how to display it.
10.Hypertext transfer protocol (HTTP) – is an application protocol for distributive, collaborative,
hypermedia information system. It is also a standard of rules for sending text across the internet it requires
an HTTP client at one end and a HTTP program at the other end- a program that requires a service from a
web server. HTTP Server- is a computer program providing services from a web server.Internet service
provider.
11. (ISP)-someone/organization] that provides access to internet or web hosting .Note; your ISP will
provide either (VSAT, wireless or DSL). That is to say, to connect to the internet, you must make a
connection to the ISP’s network, which provides “on-ramp” connection to your computer.
12.Upload- simply means to transfer a file from a local system to a remote system such as server or
another client with the intent that the remote system should store a copy of the data being transferred.
13.Protocol or network protocol- defines rules and conversions for communication between network
devices. Protocols for computer networking, all generally use packet switching techniques to send and
receive messages in the form of packets.
14.Web browser- is a s/w application that enables one to browse the www, locating and accessing
webpages.
15.Web page- is a document connected to the (www.), and viewable by anyone connected to the internet,
who has a web browser.
16.Website- is a file of information located on a server connected to the (WWW). Websites may include
text, photographic, illustrations, videos, and music or computer programs. They also often include links to
other sites in the form of hypertext, highlighted or colored text that the user can click on with their mouse,
instructing their computer to jump to the new site.Every website has a specific address on the WWW,
called Uniform Resource Locator (URL). These address end in extensions that indicate the type of
organization sponsoring the website. For example.gov for government agencies ,.edu for academic
institutions, and .com for commercial enterprises etc.
17.Intranet - is a network of computers, especially one using(WWW) convention, accessible to authorized
users, such as those within a company.
18.Webpage – is a document connected to the www and viewable by anyone connected to the internet
who has a web browser.
19.Web/WWW servers – They are computer that store and “serve” or provide access to web documents.
They are usually full- fledged internet “host computer” and sometimes provide other internet- based
services, such as FTP and Telnets.
20.Bandwidth – a measure for the speed (amount of data) you can send through an internet connection.
Note; the more bandwidth, the faster the connection.
21.Chat – an on-line text-based communication b/w internet users. Note; Chat room users register for
their chat choice, choose a username and password, and log into particular room, as most sites have
multiple chat room. Inside the chat room, generally there is a list of people currently online, who also are
altered that another person has entered the chat room. In order to chat, users type a message into a text
box. The message is almost visible in the larger command message area and other users respond.
22.Communication protocol – a standard (language and a set of rules) to allow computers to interact in a
standard way, e.g. IP, FTP, and HTTP.
23.File transfer protocol (FTP) – is internet protocol for downloading and uploading files and a number of
special application. However, if you are downloading through a webpage, the FTP requests is set up for
you by the webpage you are usually asked where you want the download file to be placed on your hard
disk, where you want the downloading transmission takes place. FTP is also an application protocol that
uses the internet TCP/IP protocols to perform downloading and uploading. Note; TCP and IP are the two
major protocol that keep the internet running smoothly. TCP manages data transfer, while IP directs
traffic to internet. FTP is underlying of TCP and shuttles files back and forth b/w FTP server and FTP
client.
24.IP Address (Internet protocol address) – a unique number identifying every computer on the internet.
E.g. (198.100.88.1)
25.DHCP (Dynamic Host Configuration Protocol) – an internet standard protocol that assigns new IP
addresses to user as needed.
26.Dial-up connection (in web terms) – a connection to internet via telephone and modem.
27.Domain Name – a name that identifies a website (e.g. Marist brothers .com)
28.DNS (domain name service) – a computer program running a web server, translating domain names
into IP address.
29.DNS server- a web server running DNS.
30Hyperlink- a pointer to another document most often a pointer to another webpage.
31.PING- a method used to check the communication b/w two computers. A “ping” is sent to a remote
computers to see if it responds.
32.MODEM- H/w equipment to connect a computer to a telephone network. Typically used to connect to
the internet via telephone line.
33.Newsgroup- an online discussion group (a section of news server) dedicated to a particular subject of
interest via telephone line.
34.SMTP (simple mail transfer protocol) - a standard communication protocol for sending email b/w
computers.
35.Telnet- is a user command and an underlying TCP/IP protocol for accessing remote computers.
Through telnet, an administrator or another user can access someone else computer remotely.
36.WAP (wireless application protocol)- a leading standard for information services on wireless terminals
like digital mobile phones.
37.Web servers- a server is a computer that delivers services or information to other computers. In web
terms, a server that delivers web content to web browsers.
38.WWW (world wide web)- a global network of computers using the internet to exchange web
documents.
Internet connection- to connect to the www, you will need a telephone line i.e. catch. When you dial into
the internet, you have the phone line tired up for as long as you are connected.
To connect to the internet, the following are required:
a.ISP- just like Telephone Company that supports your phone service, an ISP gives you access to the
internet. Each time you connect to the internet, you dial up your ISP with your modem, entering a
username and password, and then you are connected to the internet.
b. TCP/IP support- they are computer language/ called a network protocol that enables computer to
communicate with one another. All computers that connect to the internet and www must use TCP/IP.
Most computers include built in support for TCP/IP.
c. Connection software -after you configure your TCP/IP software to dial up and connect to your ISP.
This software is sometimes called dialer software, and windows have dialer s/w included in the dial-up
networking feature.
d. Internet and web software-this turns the nuts and bolts of the internet connection into the lively
browsing you hear from friends. The internet and web software is supplied with windows, and is known
as internet explorer.
Features in main browser window (parts of a browser)
Internet explorer (IE) for example, has the following parts: title bar, status bar, menu bar, and standard
toolbar, although they may be different from other applications, but their purpose and work done is the
same.
a. Status bar- displays the status of the current webpage. It displays the page address, number of elements
left to display in the webpage and also the progress of the web page being displayed
b. Scroll bars- are used to scroll through the web page.
c. Standard toolbar (browser user interface) has many different buttons, explained below:

1.Back- to go back to previously viewed webpage.


2.Forward- to move forward to a web page which was viewed just before using the back button.
3.Stop- to stop the loading of the webpage from the point forward. The webpage contents being displayed
are not changed.
4.Refresh/Reload- to refresh the content of the currently displayed webpage from the start.
5.Home- to go the homepage of the currently viewed website.
6.Search- to search from the string of text entering in the address bar.
7.Favorite/Bookmarks (location toolbar)- displays a list of previously bookmarked website. You can add
or delete the website from the favorite/bookmark.
8.History- displays a list of previous viewed website along with the date and time.
9.Mail- starts the email program.
10.Print- prints the webpages with the default settings of the printer.

Internet services-
a. E-mail- a system of transmitting messages b/w computers.
b. E-mail discussion group- are electronic mailing list provide by different service providers. They are
means of sharing information among e-mail discussion groups. When you subscribe to email discussion
group, your email address is added to the group mailing list. Henceforth, you can send one email to the
discussion group email address and it will be automatically delivered to all members of the group.
c. Telnet- a user, and an underlying TCP/IP protocol for accessing remote computers.
d. Usenet- a worldwide computer network that encompasses thousands of discussion group called
newsgroup that allows the exchange of news, comments and question on specific topics.
e. FTP- has two parts:
I. Client
ii. Server.
FTP client is a program on the computer that you are using or logged into, while FTP server is a program
on a remote computer that you are to connect to.
e. World Wide Web (WWW) etc.; is a global network of computers using the internet to
exchange web documents.
Electronic mail- popularly known as email is a method of transmitting messages b/w computers. Modern
email operators across the internet are based on a store and forward model, because e-mail Servers accept,
forward, deliver and store messages. Neither the user nor their computers are required to be online
simultaneously, they need connect only briefly, typically to an email server, for as long as it takes to send
or receive messages. Email Servers-Email now is not just sending/receiving emails, but has extended it’s
reach by offering different kinds of services to include:
i. Sending/receiving emails
ii. chatting- chat network allows you send and receive IM with friends, family and colleagues, exchange
real time notes and emoticons with anyone on the network.
iii Share updates, photos, links and anything pretty you can think off.
iv in addition to sharing voice and video chats with you contacts from computer, you can also place and
receive phone calls to any landline or mobile phone number. Note; Instant Messaging(IM)-is a real time
communication between two computers connected over a network, such as the internet.
Sending/Receiving email- (concept of email). The most popular (by usage) internet service is electronic
mail or email, used to exchange personal and business related messages and files. You can even send
music and computer programs. Just as a letter makes stops at different post offices along its journey,
email passes from one host, known as Mail Server to another as it travels over the internet. So, before one
sends/receives email, he/she needs a connection to the internet and access with an account to a mail server,
that forwards his mail. Free private Internet email services are available in the internet, including Yahoo,
Hotmail and Gmail. Provides like these will issue you an email address to identify himself for purpose of
exchanging electronic mail messages. So, for you to acquire an address, you must first of all log on to
your ISPs sites, and fill in certain information required by such a provider, and after authentication, an
account will be given to you. sSending/receiving email varies a lot,depending on what program you are
using, whom your ISP is ,and how your connection is made.To send or receive email, you must have an
email account,i.e, an email address(ID), and a user password. An example of an email account is
[email protected] name portion is the person’s unique user name on what ever system they are
using.Then after the @ sign is the domain name(address of the system you use,i.e yahoo.com).
Good features of email address
1.Send and receive both text messages and attached binary files.
2.Quote the text of a message when replying to it.
3.Send mail to multiple recipients at once,send CCs(Carbon copy)
4.Save lists of email addresses for future use in an address book.
5.Create multiple folders in which to organize in coming and outing mail, sort received email by of
several criteria (date received,sender’s name,file size etc)
6.Compose and read messages offline.
Advantages of email
a. Cheap- i.e,sending an email costs the same regardless of distance and the number of people you send to.
b.It is fast-,i.e,an email should reach it’s recipient in minutes,or at most within a few hours.
c.Secure- can be encrypted with password.
d.It is convienent- your message will be stored until the recipient is ready to read it,and you can easily
send the same message to a large number of people.
e.It is permanent-,i.e,you can keep a record of messages and replies,including details of when messages
are received.
f. You can send files to several contacts simultaneously through attachment,i.e,can share formatted files
through attachments,lower cost than conventional mail.
Disadvanges of email:
a.Spam messages- i.e, unsolicited email.
b.Viruses – easily spread through email attachments.
c.Sending email by mistake- i.e,at a click of a button,an email can go the a wrong person accidentally,
potentially leaking confidential data and sensitive business information.
d.Data storage- electronic storing space can become a problem,particularly where emails with large
attacments are widely distributed.
E-mail protocol- Email messages are generally sent to an email server that stores received messages in the
recipient’s e-mail box.The user later retrieves these messages with either a web browser or an email client
that uses one of a number of email retrieval protocols.Though most clients and servers preferentially use
Vendor specific Proprietary protocol,most support the internet standard protocols(SMTP for sending
email and POP3 and IMAP4 for retrieving email, allowing interoperability with other servers and clients.
For example,Microsoft’s Outlook,IBM’s Novels,all of those products also with these proprietary
protocols.Though, email clients are generally configured to use either POP3 or IMAP4 to retrieve email
and in both cases use SMTP for sending.Nearly, all subscribes to individual Internet Service Providers
email accounts access their email with the client s/w that uses POP3.
E-mail accounts-You can open your email account on any of the websites providing email services, such
as yahoo mail, gmail, and Hotmail.
Opening an email Account(Gmail)
a. Input the address of your ISP(gmail) in the address bar of your web browser to open the website
signup form
b. You will be greeted with the signup page of your ISP(gmail)
c. Input the details in the boxes shown, which include your name,gender,yahoo ID, etc.
Note, after entering the yahoo ID, click the check availability button to check whether the ID you
want to register is available and not been taken by someone else.Remark, password and even security
questions are important in case you forgot your password.Click the I accept create my account button
to confirm the creation your account.After the confirmation of registration, your email address will be
displayed to you.
How to write new messages and read your received emails-Go to your ISPs
website(www.gmail.com),click sign in to enter your account(i.e yahoo ID and password), and click
on sign in or press Enter to go to your mail box.Note; all your incoming messages are stored in the
inbox.If any new message are there in your mailbox, your inbox will be in Bold and number of new
messages will be mentioned in brackets.
How to write new messages: Click on the compose mail box, then compose mail Window opens,
displaying some formatting features,that you are using.c You can attach files by clicking the Attach
file button and from the resulting Window, click on Attach, to attach files and finally, click on Send,
to send the mail.After completing your work,click on sign out to log out of the mail box.Note this:
CC and BCC work similarly,they are both ways of sending copies of an email to additional
people,though you can also do this in TO field, by specifying multiple addresses.N/B, some people
refer to CC as “Courtesy Copy”. CC lists is visible to all other recipients, e.g, if you CC
[email protected] and [email protected],charles will know that jack also received the mail and jack
will also know.BCC- no one can see the lists of recipients on the BCC list.Example,
[email protected] and [email protected], both will not know that each received the mail.Someone
of the BCC list can see everything else,including the CC list and the contents of the mail.However,the
BCC list is scret- no one can see this list.(If a person is on the BCC list, they will see only their own
email on the BCC list).
Remark: TO and CC fields work similarly.You can put one address in TO field and put three in CC
field, the four people will receive the same mail and will also be able to see every other recipients
email addresses.If your Boss wants you to email someone in response of a complaint, and you want
your Boss to have a copy of it, and you don’t want the person to see your Boos’s email address, then
put your Boss’s email address in BCC field.
In email threads(replies), BCC doesn’t function like CC. example, if you send mails to Charles, and
BCC jack, if Charles replies, jack won’t get a copy of it.So, if you are sending an email to many
people use BCC(so you don’t give away everyone’s email address to everyone else). Finally email
addresses you add to “BCC” field will not be visible to the “TO” and “CC” or other “BCC” recipients.
Difference between email and website address. The following are differences between email address
and web address:
a. The email address has two componets: name and address,separated by @, while the web address
has only address components.www.maristbrothers.org- website address,
[email protected] email address.
b.email address is used to send electronic messages,while web address is the URL of web pages.
c.With email address, you can always receive electronic mails,while web address is not used to
receive mails.
d.Web address is used to access a website,where you can get information,while email not used to get
information.
Steps involved in chating(How to chat with a friend
1. Click the name of your friend in the chat section. A window will open in the lower right corner of
the page.
2. Type into the text field
3. Press Enter to send your message
4. Wait for the contact to responds.

You might also like