0% found this document useful (0 votes)
86 views93 pages

OK - ICT S3 SB Cover

The Secondary ICT Student's Book for South Sudan, developed by the Ministry of General Education and Instruction, provides comprehensive coverage of the national syllabus for Information Communication Technology. It aims to equip students with practical skills and knowledge applicable to real-life situations, fostering collaboration and creativity. The textbook is part of a broader initiative to enhance the quality of education in South Sudan, promoting good citizenship and lifelong learning among students.

Uploaded by

ATORSAH NKPETRI
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)
86 views93 pages

OK - ICT S3 SB Cover

The Secondary ICT Student's Book for South Sudan, developed by the Ministry of General Education and Instruction, provides comprehensive coverage of the national syllabus for Information Communication Technology. It aims to equip students with practical skills and knowledge applicable to real-life situations, fostering collaboration and creativity. The textbook is part of a broader initiative to enhance the quality of education in South Sudan, promoting good citizenship and lifelong learning among students.

Uploaded by

ATORSAH NKPETRI
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/ 93

South Sudan South Sudan

Secondary
ICT
Information Communication Technology
Student’s Book
Secondary ICT has been written and developed by Ministry of General
Education and Instruction, Government of South Sudan in conjunction with Subjects
experts. This course book provides a fun and practical approach to the subject
3 Secondary
ICT
Information Communication Technology
Student’s Book 3
of Information Communication Technology, and at the same time imparting life

Secondary ICT 3
long skills to the students.

The book comprehensively covers the Secondary 3 syllabus as developed by


Ministry of General Education and Instruction.

Each year comprises of a Student’s Book and a Teacher’s Guide.

The Student’s Book provides:


Full coverage of the national syllabus.
A strong grounding of the key concepts in Information Communication Technology.
Clear presentation and explanation of learning points.
A wide variety of practice exercises, often showing how Information Communication Technology
can be applied to real-life situations.
It provides opportunities for collaboration through group work activities.
Stimulating illustrations.

Student’s book
All the courses in this primary series were developed by the Ministry of
General Education and Instruction, Republic of South Sudan.
The books have been designed to meet the primary school syllabus,
and at the same time equiping the pupils with skills to fit in the modern
day global society.

This Book is the Property of the Ministry of General Funded by: Funded by:
Education and Instruction. This Book is the Property of the
Ministry of General Education
This Book is not for sale.
and Instruction.
Any book found on sale, either in print or electronic
form, will be confiscated and the seller prosecuted.
This Book is not for sale.
+RZWRWDNHFDUHRI\RXUERRNV
'R·V
 3OHDVHFRYHUZLWKSODVWLFRUSDSHU ROGQHZVSDSHURUPDJD]LQHV
 3OHDVHPDNHVXUH\RXKDYHFOHDQKDQGVEHIRUH\RXXVH\RXUERRN
 $OZD\VXVHDERRNPDUNHUGRQRWIROGWKHSDJHV
 ,IWKHERRNLVGDPDJHGSOHDVHUHSDLULWDVTXLFNO\DVSRVVLEOH
 %HFDUHIXOZKR\RXOHQG\RXUVFKRROERRNWR
 3OHDVHNHHSWKHERRNLQDGU\SODFH
 :KHQ\RXORVH\RXUERRNSOHDVHUHSRUWLWLPPHGLDWHO\WR\RXUWHDFKHU

'RQ·WV
 'RQRWZULWHRQWKHERRNFRYHURULQVLGHSDJHV
 'RQRWFXWSLFWXUHVRXWRIWKHERRN
 'RQRWWHDUSDJHVRXWRIWKHERRN
 'RQRWOHDYHWKHERRNRSHQDQGIDFHGRZQ
 'RQRWXVHSHQVSHQFLOVRUVRPHWKLQJWKLFNDVDERRNPDUN
 'RQRWIRUFH\RXUERRNLQWR\RXUVFKRROEDJZKHQLWLVIXOO
 'RQRWXVH\RXUERRNDVDQXPEUHOODIRUWKHVXQRUUDLQ
 %POPUVTFZPVSCPPLBTBTFBU
SECONDARY
South Sudan 3

ICT
STUDENT’S
BOOK 3

©2018, THE REPUBLIC OF SOUTH SUDAN, MINISTRY OF GENERAL EDUCATION AND INSTRUCTION.
All rights reserved. No part of this book may be reproduced by any means graphic, electronic, mechanical,
photocopying, taping, storage and retrieval system without prior written permission of the Copyright Holder.Pictures,
illustrations and links to third party websites are provided in good faith, for information and education purposes only.

This Book is the Property of the Ministry


of General Education and Instruction

THIS BOOK IS NOT FOR SALE


FOREWORD

I am delighted to present to you this textbook, which is developed by the Ministry of General
Education and Instruction based on the new South Sudan National Curriculum. The National
Curriculum is a learner-centered curriculum that aims to meet the needs and aspirations of the
new nation. In particular, it aims to develop (a) Good citizens; (b) successful lifelong learners;
(c) creative, active and productive individuals; and (d) Environmentally responsible members of
our society. This textbook, like many others, has been designed to contribute to achievement
of these noble aims. It has been revised thoroughly by our Subject Panels, is deemed to be
fit for the purpose and has been recommended to me for approval. Therefore, I hereby grant
my approval. This textbook shall be used to facilitate learning for learners in all schools of
the Republic of South Sudan, except international schools, with effect from 4th February, 2019.

I am deeply grateful to the staff of the Ministry of General Education and Instruction, especially Mr
Michael Lopuke Lotyam Longolio, the Undersecretary of the Ministry, the staff of the Curriculum
Development Centre, under the supervision of Mr Omot Okony Olok, the Director General
for Quality Assurance and Standards, the Subject Panelists, the Curriculum Foundation (UK),
under the able leadership of Dr Brian Male, for providing professional guidance throughout the
process of the development of National Curriculum and school textbooks for the Republic of
South Sudan since 2013. I wish to thank UNICEF South Sudan for managing the project funded
by the Global Partnership in Education so well and funding the development of the National
Curriculum and the new textbooks. I am equally grateful for the support provided by Mr Tony
Calderbank, the former Country Director of the British Council, South Sudan; Sir Richard Arden,
Senior Education Advisor of DfID, South Sudan. I thank Longhorn and Mountain Top publishers
in Kenya for working closely with the Ministry, the Subject Panels, UNICEF and the Curriculum
Foundation UK to write the new textbooks. Finally, I thank the former Ministers of Education,
Hon. Joseph Ukel Abango and Hon. Dr John Gai Nyuot Yoh, for supporting me, in my previous
role as the Undersecretary of the Ministry, to lead the Technical Committee to develop and
complete the consultations on the new National Curriculum Framework by 29 November 2013.

The Ministry of General Education and Instruction, Republic of South Sudan, is most grateful
to all these key stakeholders for their overwhelming support to the design and development of
this historic South Sudan National Curriculum. This historic reform in South Sudan’s education
system is intended to benefit the people of South Sudan, especially the children and youth and
the future generations. It shall enhance the quality of education in the country to promote
peace, justice, liberty and prosperity for all. I urge all Teachers to put this textbook to good use.

May God bless South Sudan. May He help our Teachers to inspire, educate and transform the
lives of all the children and youth of South Sudan.

Deng Deng Hoc Yai, (Hon.)


Minister of General Education and Instruction, Republic of South Sudan
Table of Contents

Unit 1 Simple Websites ................................................................1


1.0 Introduction to simple websites .......................................................2
1.0.1 Personal blog .............................................................................2
1.0.2 Uses of a blog ...........................................................................3
1.0.3 Differentiating a blog and a social network account ............5

Unit 2 Social Networks ...............................................................32


2.0 Introduction ..................................................................................... 33
2.1 Google+ ............................................................................................ 39
2.1.1 Google features ...................................................................... 39
2.1.2 Build Your Circles .................................................................. 41
2.1.3 Posting content ....................................................................... 42
2.2 Students circle network .................................................................. 42
2.2.1 Features................................................................................... 43
2.2.2 Advantages of social networking ........................................ 44

Unit 3 Programming ..................................................................50


3.0 Computer Programming ................................................................ 51
3.0.1 Characteristics of a computer program............................. 51
3.0.2 Commonly used programming language .......................... 53
3.0.3 Similarities between different programming languages .. 55
3.0.4 Basic types of Data Structures ........................................... 64
3.1 Algorithm ......................................................................................... 68
3.1.1 Categories of algorithms ..................................................... 68
3.1.2 Characteristics of an Algorithm .......................................... 68
3.1.3 How to write an algorithm................................................... 68
3.1.4 Translating algorithm into a computer program .............. 70
3.3 How to Make a Program Using Notepad .................................... 77
3.3.1 Creating a program ............................................................... 78
3.3.2 Ethical conduct in computer usage .................................... 79

iii
Unit 1 Simple Websites

LEARNING OUTCOMES

By the end of this unit you should;


• Know about appropriate software tools to create, manage and
update a personal/simple website, e.g. blogs.
• Be able to use software tools to create personal website/blog

• Be able to manage and update a website/blog.

1. What is a website/blog?
2. How is a personal/simple website/blog created, managed and
updated?
3. How could one use a simple website/blog to promote a
personal pro le?
4. How does a personal website contrast with a social network
account?
5. What are the advantages and disadvantages of personal
websites/blog?
6. How can (education) institutions bene t from simple
websites/blogs?

1
1.0 Introduction to simple websites

Fig 1.1 website page

1.0.1 Personal blog

2
Fig 1.2 a blog

1.0.2 Uses of a blog

Personal Diary

Informal Engagement

3
Building a Community

Fig 1.3

Advantages of a blog
1.
2.
3.
4.
5.
6.

4
1.0.3 Differentiating a blog and a social network account
Social network account Blog
1. Contribu ons are amde by users
who join the site and set up with the most recent post
individual accounts. Some appe first.
networks may have different
account types for individuals topically by being classified into
categories or tags which users
can browse to fi posts on
vary depending on the nature of related topics.
the site. Members may be able
to share links text, photos and so that readers can respond
other media and interact with
one another in various ways.
3. The social network may have choose to moderate comments
policies in place to prevent illegal by outside contributors.
or rude behavior and may have

them.

allows users to friend or follow


other users so they can make

and consume content from


those with similar interests.

measurement tools such as


follower counts, upvotes and
other features that members
use to measure their impact.

Activity 1.1
(In pairs)
1.

2. What are the main disadvantages of blogs for campaigns?

5
Ensuring Content Quality


• It is well-written.
• It is original.
• It is relevant to the needs of the targeted audience.
• It is highly informative.

• It contains fresh and up -to -date information.

The Audience

Schedule of Posts

6
Keywords

Filter Comments

Reference

7
Activity 1.2

Creating a blog using WordPress


Choose a good domain name that is:


1.

8
2.

3.


Step 1: go to bluehost.com

Fig 1.4

9
STEP 2: Choose Website Hosting Plan
get started now

Fig 1.5
STEP 3: Pick a Domain Name

YourCompanyName.com
YourName.com

STEP 4: Fill In Your Details

Fig 1.6

10
STEP 5: Check Your “Package Information” and Finish Registration

Fig 1.7

11
STEP 6: Create Your Password
:

Fig 1.8

B: set up & customize your site

is

Installing WordPress

access to

C: Choosing a Theme/Template for your site

12
-

2. Access free themes

Fig 1.9

Fig 1.10

13
You should also look for themes that are “responsive”, as this means they will
look good on any mobile device.
3. Install your new theme

Fig 1.11

Adding pages to the menu


If you want your new page to be linked to in your navigation bar,

14
OR

Customization
Changing Your Title and Tagline

Disabling Comments for Posts & Pages

How to shut comments off on WordPr:ess pages

Want to disable comments on every new page by default?

15
Setting Up a Static Front Page

T o set up a static front page:

Plugins

16
4: Adding/Wring Blog Posts and Pages

Adding a New Post

Fig 1.12

17
Adding Images

Fig 1.14

Fig 1.15

18
Fig 1.16

Adding a Link

Fig 1.17

19
Fig 1.18
o URL

o “Link Text”

o ,

20
It is a good idea to use headers and bolding to make your content easier t o
read and scan.
Adding Headings

Fig 1.19

Fig 1.20

21
o “B” is for bolding
o “I” is for italics
o “U” is to underline your text
o “A” will open a dropdown menu where you can select font color

Activity

Legal issues in blogs

Copyright Legal Issues

22
Trademark Legal Issues

23
Defamation

Privacy

24
Dealing with Negative Feedback

1.

2. Ignore:

25
3. Remove:

Activity 1.3

Review exercise
1.
2.
3.
4.
5.

6.
7.

26
Remember
SIMPLE WEBSITES
ACCESSIBILITY: Relates to web design/coding standards and refers to how easy it
is for everyone to use your website, including people who are visually impaired
or in any way physically handicapped, or limited by older or less common

smart -phones, accessibility for use on all devices is important; especially with
the growing number of people using smaller screen devices to go online.
ADDRESS BAR: The white bar towards the top of your computer screen. It will

type in the address of a website that you want to visit.


ANCHOR TEXT: The text a link (hyperlink) uses to refer to your web page. These
make a difference in your search engine results.
ASCII:
represents English characters as numbers, ranging from 0 to 127. Commonly
used by computers and browsers, ASCII codes make it possible to transfer data
from one computer to another computer (like a server). In terms of transferring
data from a computer to a server (called “uploading”), you would need to use
either ASCII or Binary, depending on the type of file being transferred
BACKLINKS: Links from other website pages to yours. Backlinks are used to
increase a site’s popularity with search engines and to get more people to visit
your site. The quality of a backlink and its anchor text is factored into Google’s
algorithm when deciding how much importance to place on it.
BANDWIDTH: This relates to how much a resource is used. An analogy would
be a freeway. The wider the freeway, the more tra c (users) it can handle. The
narrower it is, the less people can use it at once (without problems). When a
website gets a lot of visitors, it will use a lot of bandwidth.
BETA:
it but can expect some hiccups.
BINARY: A numbering system that consists of only two numbers, 0 and 1.
Everything that you type or input into a computer is converted into binary – a

files need to be transferred

binary for uploading is ASCII.

27
BLOG: An online journal or diary and a very popular current method of sharing

CACHE:

to wait from scratch. The place where it stores all this is called the “cache”. The
irony is that if your cache gets too full, it in fact makes your computer work a lot
slower. It is a good idea to empty your cache regularly to keep your computer

CASCADING STYLE SHEETS: Also referred to simply as CSS, Cascading Style


Sheets are used to defi the look and feel of a web site outside of the actual
HTML fi of the site. In recent years, CSS has replaced tables and other HTML-
fits
to using CSS but some of the most important are the simplifi
HTML fi (which can actually increase search engine ranking) and the ability to
completely change the style of a site by changing just one fi without having to
make changes to page content.
CHAT: In the context of the internet “chat” is a feature that allows users from all

messenger. This has to be especially downloaded and installed from a website


that uses this technology.
COOKIE:
computer when you visit them. Cookies are normally harmless and the reasons

computer rather than from the website itself . Another use is to track visitors to

be used to check when you last visited and, if any changes since then, to force

computer will begin to get bogged down with all of this in its memory. It is
therefore a good idea to regularly clear the cookies from your computer.

28
DOMAIN:
It is commonly used to mean the name of your website.
EMAIL: The internet equivalent to post and mail, email is an encoded message
that is sent instantly to someone else’s computer. It is however a “best

internet itself and the vast number of things that can cause the process to stall
or fail.
FAVICON: ×16 pixels, though some are 32×32
pixels), customizable icons displayed in the web address bar in most browsers
next to the web address. They are either 8 -bit or 24-bit in color depth and are
saved in either .ico, .gif or .png fi formats. The favicon used by Thinking IT is
the head logo.
FIXED WIDTH LAYOUT: Fxed width layout has a set width (generally defi
in pixels) set by the designer. The width stays the same regardless of screen

to be made to a design that will stay consistent across browsers. Designers have

of layout.
FONT FAMILY: fining the typefaces used

and usually ends with the generic font category (such as “serif” or “sans-serif”).
GIF: A type of fi used for images, especially animated graphics and line -
drawn images (as op posed to photographs). A .gif image can be saved with a
transparent background, making it ideal for graphic overlays.
HOST / HOSTING:In order for you to have an email address or a website, a

that is taking place

HTML: Hyper Text Markup Language. This is the base language that is used

In other words, it does not interact with the visitor other than in the most basic
ways. It stores no data and cannot return data other than what is consistently on
the page itself . Emails that use different fonts, colors, borders, backgrounds and

29
HTTP:

being accessed and transferred. For example, web sites and web pages are one
fi by their domain name (www.mountainpublishers.
co.ke).
HYPERLINK: A hyperlink is a link from one web page to another, either on the
same site or another one. Generally these are text or images, and are highlighted
fferent color or font weight).
The inclusion of hyperlinks are the “hyper” part of “hypertext.”
HYPERTEXT: Hypertext is any computer -based text that includes hyperlinks.

to plain text and links.


IP or IP ADDRESS: Internet Protocol address refers to the actual number that a
web address name translates to. (Also see “domain”). The IP number is the real
address.
JAVASCRIPT: Coding languages used to achieve eff
that normal html and its variants cannot achieve. These bits of coding (or

different to Java.
LAN :
to each other. Using LAN enables fi sharing amongst different computers

LANDING PAGE: A landing page is the page where a visitor firs t enters a website.

META DATA: this is the data contained in the header that off

the metadata is not viewable on the web page (except in the source code). Meta
data is contained within Meta tags.
NAVIGATION:

links that allow a visitor to move from one page to another are included in

PLUG IN:

30
without having to
redo the core coding of the site. Plugins can also refer to bits of third -party

SPAM: Spam is junk mail, normally sent out in bulk and normally with no regard
as to whether you want to receive it or not. Serious spammers will in fact use
your protests as proof that you are seeing their emails and spam you even
more.
UPLOAD: For a website to be visible to the world, it has to be put on the server

URL: Uniform Resource Locator. (Allows all resources on the internet to be


located in a uniform manner). A URL is a website address that has all the

mountainpublishers.com/content.php?page=4 terminology is this exact page’s

WEB PAGE or PAGE: Just one page rather than a complete website (see below).
A page is not the same as, for example, the page in a book. The length is not
limited by a fi

31
Unit 2 Social Networks

LEARNING OUTCOMES
By the end of this unit you should be able to:
• Know the purpose of and how to use social networks by
creating personal pro les and interacting via, e.g. LinkedIn,
Google+, Student Circle Network etc.
• Explore social networks.
• Be able to join social networks.
• Be able to interact in social networks.
• Analyze risks in accessing social networks.

• Contrast di erent social Networks.

1. What are social networks and how do they contrast with social
media?
2. How do social networks service communities with common
interest and goals?
3. What are the risks involved in interacting in social networks?
4. How could individuals and institutions bene t from social
networks?
5. What impact have virtual social networks had on the traditional
network institutions?

32
2.0 Introduction

di

Activity 2.1

33
Exercise
1.
2.

Importance of social networks


1.

2.

3.

tra

LinkedIn

Fig 2.1

34
Note: Before you create any account online, make sure you read through the
User Agreement as well a s the Privacy Policy before creating the account.

Fig 2.2

35
Fig 2.3

Fig 2.4

36
Fig 2.5

Fig 2.6

37
A er comple ng all the strps you should have a page like this.

Fig 2.7

Activity 2.2
1. Create your own account in LinkedIn. Write your profile, job preference,
and interest. Make connec ons with friends, classmates and peers by
them to connect.
2. Discuss the importance of reading through the User Agreement and the
Privacy Policy the account.

Exercise
1. How can LinkedIn be used to promote business growth and
entrepreneurship in south Sudan.
2. List various ways in which LinkedIn could be used to address various
challenges aff

38
2.1 Google+

Fig 2.8: Google+ webpage

2.1.1 Google features

+1 lets people ‘like’ your Google+ page

Google+ circles

Hangouts

39
Events

di
invites
will automatically go out to whoever you select from individuals or groups.
Insights

Google My Business
Google My Business is a local business listing pagethat is perfect for local
businesses. They allow you to display reviews, photos, key business information
like opening times and contact details, as well as displaying a fully integrated
Google location map. This provides you with another customer touch point and

you are totally new to Google, avoid setting up a regular page, set up a location
based Google My Business page instead, so you do not end up running two
pages in tandem.

40
Go to plus.google.com and click“Create an Account” on the top right.

le

2.1.2 Build Your Circles

41
2.1.3 Posting content

Activity 2.3

2.2 Students circle network

42
for free via the Internet. Students circle network is an OpenCourseWare

Students Circle Network has members from over 120 countries and 200

network has introductory courses for high school students.


2.2.1 Features
As a social network, Students Circle allows its
members to create personal profiles, private message, chat, share

contents.
Students Circle presents aggregated courses

resources are divided into graduate courses, undergraduate courses,


language studies, and introductory courses.
There are over 15 study groups in different academic
disciplines that allow students to schedule live online study sessions
with each other. This live chat is powered by Tiny Chat and provides

Social games are an integral part of the network


allowing students to interact over games.

Activity2.4
1. Create a student circle account and check into academic contents that are
relevant to your area of study.
2. Using this account create a study group with live study sessions among
the groups in your class.

43
Exercise
1.
2.

3.

2.2.2 Advantages of social networking


Commonality of Interest:

44
Activity2.5
1.
2.
3.

Review exercise

45
Remember

SOCIAL NETWORKS
Company Page
business and create updates about their business and their industry.

LinkedIn updates.
- An indicator that you and a person are connected to each other.
- Invite someone to join your network and connect with you.
- A way to introduce yourself to those you are not currently
connected to.
Groups - These can be public or private, and can be created by an individual or
company. It allows users to come together and talk about a fi subject on
one page.
Network

- A way to recommend a friend/colleague, based on their


professional experience, to anyone who views their pr fi
Infl rs -
with great content.
LinkedIn Today- A source for all of your industry news in one place.
P fi - This is the landing page that displays your profi
you have provided, and the content you have posted to Google Plus.
Page - Similar to a pr fi a Google Plus Page is created by a business or a brand.
Constant fier that is bound to an invariant value.
Constructor - A class method (in object-oriented programming) that creates and

Data type
the possible values that can be taken, how they are stored, and what range of

Destructor - In object-oriented programming, the command sequence that is


fi hed.
Dump

46
- A data type whose values are a set of mutually exclusive named
constants.

Flow chart fines the flow of


control through a program
Formal argument

result.

goto / go to
to another part of a program .
Heap - An area of memory reserved for dynamically allocated data objects,
contrasted to the stack.

Share

Comment
Tag

Google Plus Streams

Circles

47
Extended Circles

Local

Hangout
Hangout on Air (HOA)

Google Plus Bar (or Sand Bar)

48
49
Unit 3 Programming

LEARNING OUTCOMES

By t he end of this unit you should;


• Know how to write a simple program, e.g. to print ‘Hello

• Understand ethical conduct in computer usage.


• Be able to write simple computer programs.
• Perform the conversion of a numerical algorithm into a
program.
• Recognize ethical issues in computer usage..

1. What is programming?
2. What is an algorithm?
3. How is a simple computer program designed and created?
4. How is a numerical algorithm translated into a computer
program?
5. What is the ethical conduct in the computer usage (copyrights)?

50
3.0 Computer Programming

to enable a computer to do a certain task . It is a process that leads from an

3.0.1 Characteristics of a computer program.


1. Consistency

mistakes, such as mistakes in resource management (e.g., buffer ov flows and


ff-by-one errors).
2. Robustness

3. Usability: the ergonomics of a program: the ease with which a person can

purposes. Such issues can make or break its success even regardless of other

of a program’s user interface.


4. Portability
on which the source code of a program can be compiled/interpreted and
run. This depends on diff
the diff

source code.
5. Maintainability: the ease with which a program can be modified by its


fference in this regard. This quality may
not be directly apparent to the end user but it can ficantly affect the fate of
a program over the long term.
6. E formance : Measure of system resources a program consumes

careful management of resources, for example cleaning up temporary files and

51
Programming language

Types of Programming Languages


1. Procedural Programming Language

5. Logic Programming Language

52
3.0.2 Commonly used programming language
1. Java

2. C Language

3. C++

4. C#

53
6. PHP

7. Python

9. JavaScript

10. SQL

54
3.0.3 Similarities between different programming languages

1.

2.
appropriate sequence of statements.
3.
4. Input: Gather data from the keyboar fi evice.
5. Output: Display data on the screen or send data to a file or other device.

The Di erence between Di erent Programming Languages


Different programming languages support different styles of programming. The

policy, suitability to task, availability of third-party packages, or individual


preference.

Dat

string, for example, is a data type that is used to classify text. An integer is a data
type used to classify whole numbers. Data types simply refers to the type and

55
The data types can roughly be described as: numbers, Booleans, characters,

“strings”. Object oriented languages, such as C++ and Java replace “structures”
with “objects”.

language requires a variable to only be used in ways that respect its data type,
that language is said to be strongly typed. This prevents errors, because while

extent to which a programming language discourages or prevents type error is


known as type safety.
Data types can roughly be described as: numbers (e.g., 7, 3.14), Booleans (true
or false) , characters (‘a’, ‘b’, ... ‘z’, ‘1’, ‘2’, ... ‘9’, ‘!’, ‘^’, etc) , arrays (a list of data

“strings”. Object oriented languages, such as C++ and Java replace “structures”
with “objects”.

1. Strings
One of the most widely used data types is a string. A string consists of one

characters. A string is like a plain text.


A string represents alphanumeric data. This means that a string can contain
many different characters, but they are all considered as if they were text, even
if the character s are numbers. A string can also contain spaces. This presents a

and end of a string with a special character, typically a quote. For example, the
following code is used to print text to the screen: print ‘Hello World!’
The use of quotes ensures that the text ‘Hello World!’ is recognized as a string
and not as two separate words that may have some special meaning in the
programming language. The use of quotes also makes it possible to use
numeric characters as part of a string. For example, the following code is used
to store a street address: address = ‘123 Central Avenue’
Without the quotes, the numeric characters 123 would be interpreted as
a number, but with the quotes, it is recognized as being part of a string that
represents a street address.

56
2. Numeric Data Types

result = 3 * 117.89

3. Boolean data

Example
use strict;
my ($name, $password); print
“\nName: “; chomp($name =
<STDIN>); print “\nPassword:
“; chomp($password = <STDIN>);
if (($name eq “bob”) && ($password eq “example”))
{
print “Success\n”;
} else {
print “Fail\n”;
die;
}

57
4. Character data type

• The data types CHARACTER CHAR) and CHARACTER VARYING


(VARCHAR) are collectively referred to as character string types, and
the values of character string types are known as character strings.

octets


to 24

CHAR(24) /* -length */VARCHAR(24) /* variable -length */


58
An element is accessed by indexing the array name. This is done by placing the
index of the element within square brackets after the name of the
array

int var = number[9];


The above statement will take the 10th element from the array and assign the
value to var variable. The following example uses all the above- mentioned
three concepts viz. creation, assignment, and access ing arrays.

#include <stdio.h>

int main () {

int number[10]; /* number is an array of 10 integers */


int i = 0;

/* Initialize elements of array n to 0 */


while( i < 10 ) {

/* Set element at location i to i + 100 */


number[ i ] = i + 100;
i = i + 1;
}

/* Output each array element’s value */


i = 0;
while( i < 10 ) {

printf(“number[%d] = %d\n”, i, number[i] );


i = i + 1;
}

return 0;
}

59
When the above code is compiled and executed, it produces the following
result –
number[O] = 100
number[l] = 101
number[2] = 102
number[3] = 103
number[4] = 104
number[5] = 105
number[6] = 106
number[7] = 107
number[8] = 108
number[9] = 109

6. Structures
Structure is a group of variables of different data types represented by a single
name.
Let’s say we need to store the data of students like student name, age, address,
fferent variable for each

then in that case, you would need to create these several variables again for
each student. This is such a challenge to store data in this way.
We can solve this problem easily by using structure. We can create a structure
that h as members for name, id, address and age and then we can create the
variables of this structure for each student.
We use struct keyword to create a structure in C. The struct keyword is a short
form of structured data type.

struct struct_name { Da;taType member1_name


DataType member2_name; DataType member3_name;

};
Here struct_name can be anything of your choice. Members data type can be
same or different. Once we have declared the structure we can use the struct
name as a data type like in fl at etc.

etc. and then we will see a complete example.

60
struct struct_name var_name;
or

struct struct_name {
DataType member1_name; DataType member2_name;
DataType member3_name;

} var_name;

var_name.member1_name;
var_name.member2_name;

var_name.memeber_name = value;

struct struct_name var_name =


{value for memeber1, value for memeber2 …so on for all the
members}

61
Example of Structure in C

#include <stdio.h>
/* Created a structure here. The name of the structure is
* StudentData.
*/
struct StudentData{ char *stu_name; int stu_id;
int stu_age;
};
int main()
{
/* student is the variable of structure StudentData*/
struct StudentData student;

/*Assigning the values of each struc t member here*/


student.stu_name = “Steve”;
student.stu_id = 1234;
student.stu_age = 30;

/* Displaying the values of struct members */


printf(“Student Name is: %s”, student.stu_name);
printf(“\nStudent Id is: %d”, student.stu_id); printf(“\nStudent
Age is: %d”, student.stu_age); return 0;
}

Student Name is: Steve


Student Id is: 1234
Student Age is: 30

62
Data structure

Types of data structures

63
3.1 Activity
Di

3.0.4 Basic types of Data Structures




Fig 3.1

64
Activity 3.2
1.

2.
3.

Exercise
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

65
rst released

B A S I C

Fig 3.2

Replace
#include “stdafx.h”
#include <iostream>
using namespace std;

int main()
{
cout << “Hello World! “;
return 0;
}

66
Fig 3.3
line 12

console window

Activity 3.3
1.
2.

67
3.1 Algorithm

3.1.1 Categories of algorithms







3.1.2 Characteristics of an Algorithm




3.1.3 How to write an algorithm

do

68
Sum of Two Numbers:
step 1
step 2 a & b
step 3
step 4
step 5

Examples of algorithm in programming

69
Activity 3.5

1.

2.
3.

SUB Regress(x, y, n, al, a0, syx, r2) Sumx=0: sumxy=0: st=0


Sumy=0: sumx2=0: sr=0
DOFOR i=1, n Sumx=sumx=xi Sumy=sumy=yi Sumxy=sumxy=xi*yi
sumx2=sumx2=xi*xi
END DO
Xm=sumx/n
Ym=sumy/n
a1=(n*sumxy -sumx*sumy)/(n*sumx2-sumx*sumx)
a0=ym-a1*xm DOFOR i=1, n St=st+(yi-ym)2
Sr=sr=(yi-a1*xi-a0)2
END DO
Syx=(sr/(n-2))0.5
r2=(st-sr)/st
END Regress

3.1.4 Translating algorithm into a computer program

Building a Program

70
To develop the algorithm, the programmer needs to ask:
a) What data has to be fed into the computer?

that cause the input data to be turned into the desired output data.

a) Flowchart:
program.
b) Nassi Schneider Mann charts: Uses specific shapes and symbols to represent
different types of program statements.
c) Pseudocode: A verbal shorthand method that closely resembles a
programming language, but does not have to follow a rigid syntax structure.

Fig 3.4: program flow chart

71



ax2



72
#include <iostream>
#include <cmath>
using namespace std;

int main() {

a, b, c, x1, x2, discriminant, realPart, imaginaryPart;

cin >> a >> b >> c;


discriminant = b*b - 4*a*c;

if (discriminant > 0) {
x1 = (-b + sqrt(discriminant)) / (2*a);
x2 = (-b - sqrt(discriminant)) / (2*a);

cout << “x1 = “ << x1 << endl;


cout << “x2 = “ << x2 << endl;
}

73
else if (discriminant == 0) {
cout << “Roots are real and same.” << endl;
x1 = (-b + sqrt(discriminant)) / (2*a);
cout << “x1 = x2 =” << x1 << endl;
}

else {
realPart = -b/(2*a);
imaginaryPart =sqrt(-discriminant)/(2*a);

cout << “x1 = “ << realPart << “+” << imaginaryPart


<< “i” << endl;
cout << “x2 = “ << realPart << “-” << imaginaryPart
<< “i” << endl;
}

return 0;
}

Output

5
1

x2 = -1

74
Basic Declarations and Expressions

75
}

76
3.3 How to Make a Program Using Notepad
You can technically write and run a program in Notepad using any coding
language available, but you must save the program in the correct format for the
program to run. All Notepad files save as text documents by default.
The easiest way to open Notepad is by clicking Start, typing in , and
clicking the blue Notepad icon at the top of the Start window.
Determine your programming language. Notepad does not exclude any
languages, but you will need to use the same language throughout the document
to remain consistent.
Press
you will always need to place new lines of code on a new Notepad line.
Close any open brackets and parentheses. Whenever you open a bracket or
parenthesis (e.g., { or [ ), you must close it with the opposite-facing counterpart
in order to complete a line of code. Failing to do so will result in errors.

Fig. 3.5
finitely not the

77
3.3.1 Creating a program
Open Notepad

Enter your program’s code

Click File

Click Save As

Click All Files

8. Enter a name for your program.

9. Add the program’s extension to the name.

• .bat

• .htm

• .py

• .cpp


watermelons.bat

10. Click Save.

78
3.3.2 Ethical conduct in computer usage

a) Computer crime

c)

Privacy of the company, workers, and customers

79
1.

2. Avoid harm to others

3. Be honest and trustworthy

4.

5. Honor property rights including copyrights and patent.

80
6. Give proper credit for intellectual property.

7. Respect the privacy of others.

8.

Intellectual property rights

1.

81
2.

3.

Activity 3.6

a)
b)
c)

Exercise

1.
2.
3.
4.
5.
6.
7.

82



8.
9.
10.

Practical exercise
1.







2.





3.





83

4.











5.





6.




7.



84
8.



• 123



• 13 14 15
9.


• 25
• 35

• 14
• 45



10.





85
Remember
Programming

Actual argument
App

Argument

Argument
Array

Boolean
Class

Compiler
Constant
Constructor

Data type

Destructor

Dump

86
Flow chart

Formal argument

goto / go to

Heap

Integer
Interpreter

Linker / link editor

Logic programming

Machine code

Method

Module

Paradigm

87
Parameter

Procedure
Program

Real

Source code

Stack

String

Superclass

Type

88

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy