You are on page 1of 24

ICT Compulsory Part 1

Ch.2 Data Organization and Data Control


Error
Data Source Error 數據源錯誤 (Input)
~ The data source providers provide incorrect data.
(e.g. An interviewee gives an incorrect ID number.)

Transcription Error 轉錄錯誤 (process) This revision note is just for


those students who have no
~ Data is read or typed incorrectly. idea with Ch.2, Ch.3, Ch.6, Ch.7
Only.
(e.g. “1” as “l” or “o” as “0”)
其他靠自己 😑

Transposition Error 調換錯誤 (process)


~ Two consecutive digits are swapped.
(e.g. “61” as “16”)

Garbage-in-garbage-out (GIGO)
~ Erroneous data always produces inaccurate information. It is known as
Garbage-in-garbage-out.

Data Control
1. Data Validation 數據有效性校驗

2. Data Verification 數據校驗

Prepared by Wong Yik Pok 4E 16 1


ICT Compulsory Part 1

Data Validation 數據有效性校驗

1. Field Length Check 字段长度检查


Ensure that the data has the correct number of characters or digits.
(Such as a domestic telephone number in Hong Kong must have 8 digits)

2. Range Check 範圍檢查

Ensure that the data value is within a pre-determined range.


(Such as the mark of a test is 100, so it cannot greater than 100 and smaller
than 0.)

3. Type Check 類型檢查


Ensure that the data types are correct.
(The students’ examination mark should be number not characters)

Parity Check 奇偶校驗

~ Parity check is a common application of check digit in digital data transmission.


For Example
101100000 101100001

Odd parity bit Even parity Check

If the number of “1” in binary number is odd, an even parity number is set 1.
Vice versa, if the number of “1” in binary number is even, an odd parity number
is set 0.

Prepared by Wong Yik Pok 4E 16 2


ICT Compulsory Part 1

Question 1
Calculate the value of the parity bit.
Data: 1 1 1 1 0 1 1 0 (send in odd parity) à The odd parity bit is 1.
Data: 0 1 1 1 0 0 1 1 (send in even parity)à The even parity bit is 1.

Question 2
Decide whether the data is error-free.
Data: 1 0 1 1 1 1 1 0 (send in odd parity) à The data is error free. (i.e. 六個”1”)

Data: 0 0 1 1 0 0 1 1 (send in even parity)à The data is correct. (i.e. 四個”1”)

Example for check digit (HKID Card)


Check Digit
ID Number D=4 2 8 8 7 5 4 2
Weight 8 7 6 5 4 3 2 1
ID Number * Weight 32 14 48 40 28 15 8 2
The total: 32 + 14 + 48 + 40 + 28 + 15 + 8 + 2 = 187
As 187 is divisible by 11, so it is a valid ID Card.

Data Verification 數據校驗


1. Input Data Twice
2. Double Data Entry

Input Data Twice Double Data Entry


~ An operator inputs the data twice ~Two operators enter the same source
allows the computer to check the second documents into two different files. The
entry against the first one. computers compare the 1st with 2nd one.
Prepared by Wong Yik Pok 4E 16 3
ICT Compulsory Part 1

Data Hierarchy 數據層次


1. Field à It represents a specific fact of record.
2. Record à It contains information of a specific entity.
3. Table à It contains the information of all entries stored in specific record formats.
4. Database à It is a collection of related tables.

Database Management System (DBMS)


Functions of DBMS:
1. Manage the database structure
2. Store, organize and retrieve data in a database.

Basic Functions to organize a table ((Very Important) ****


This is part is also useful for Ch.8 Databases

Create a table (SQL Command) Structured Query Language


Situation 1
To create a table ‘Members’ with field ‘Name’, ‘Class’, and ‘Age’ (4 Marks)
CREATE TABLE Member
(Name CHAR (25), Class CHAR (2), Age Decimal (3, 0))

CHAR: Character
Decimal: Number
(25), (2), (3,0) are represent the character is limited to the according number. For
(25), The number of characters of ‘name’ field cannot not more than 25. The
limited number should be reasonable.

Prepared by Wong Yik Pok 4E 16 4


ICT Compulsory Part 1

Situation 2 (Remove the field ‘Age’ from the table ‘Member’)


ALTER TABLE Member DROP Age

Situation 3 (Delete table Member)


Drop TABLE Member

Situation 4 (Add Record)


Name Wong Yum Yui Chan Pak San Wong Yik Pok
ID S181272 S180113 S17082
Age 16 16 17
(Not the same from situation 1)
CREATE TABLE Student
(Name CHAR (25), ID CHAR (7), Age Decimal (3, 0))

INSERT TABLE Student


VALUES (“Wong Yum Yui”, “181272”, 16)

INSERT TABLE Student


VALUES (“Chan Pak San”, “180113”, 16)

Situation 5 (Deleting existing records)


To delete all records of students who are younger than 17 by using situation 4.

DELETE FROM TABLE Student WHERE Age < 17

Wong Yum Yui and Chan Pak San are missing after the function run

Prepared by Wong Yik Pok 4E 16 5


ICT Compulsory Part 1

Situation 6 (Modify existing records)


Student whose age are 16 or above, add 1 by using situation 4.
UPDATE TABLE Student
SET Age = Age + 1
WHERE AGE >= 16

Wong Yum Yui, Chan Pak San and Wong Yik Pok are added 1 respectively when
the function run.

Prepared by Wong Yik Pok 4E 16 6


ICT Compulsory Part 1

Ch.3 Number and Character Coding Systems


Denary (base 10) Binary (base 2) Hexadecimal (base 16)
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

Binary to Denary
Binary digit 1 0 1 1
Place Value 23 22 21 20
Digit Value 1 x 23 0 x 22 1 x 21 1 x 20
\ 1 1 0 1 2 = 1 x 23 + 0 x 22 + 1 x 21 + 1 x 20
= 1 1 10

Prepared by Wong Yik Pok 4E 16 7


ICT Compulsory Part 1

Hexadecimal To Denary
Binary digit 2 C A 9
Place Value 163 162 161 160
Digit Value 2 x 163 12 x 162 10 x 161 9 x 160
\ 2CA916 = 2 x 163 + 12 x 162 + 10 x 161 + 9 x 160
= 1 1 4 3 3 10

Denary to binary
Covert 3710 into a Binary number.
2|37
2|18 …1
2|9 …0
2|4 …1 \ 3710 = 1 0 0 1 0 1 2

2|2 …0
1 0

Denary to Hexadecimal
Covert 42010 into a Hexadecimal number.
16|420
\ 42010 = 1 A 4 16
16|24 ……4
1 …… 10 <-- A

Convert 1 0 0 1 1 1 1 1 2 into Hexadecimal number.


Step 1: 1001 1111
Step 2: 10012 = 916
11112 = F16
\ 1 0 0 1 1 1 1 1 2 = 9F16

Prepared by Wong Yik Pok 4E 16 8


ICT Compulsory Part 1

Convert 1 0 1 1 1 1 2 into Hexadecimal number.


Step 1: 0010 1111
Step 2: 00102 = 216
10112 = B16
\ 1 0 1 1 1 1 2 = 2B16

Convert A716 into Hexadecimal number.


A16 = 10102
716 = 1112 = 01112
\ A716 = 1 0 1 0 0 1 1 12

Convert 30D 16 into Hexadecimal number.


316 = 00112
016 = 00002
D16 = 11012
\ 30D 16 = 0 0 1 1 0 0 0 0 1 1 0 1 2
= 1 1 0 0 0 0 1 1 0 1 2 (Discard all the leading ‘0’ digits.)

Bits and Bytes

~ Bits is the smallest unit of computer data. A bit is usually a short form of a binary digit.

1. 1 Byte(B) = 8 bits
2. 1 Kilobyte (KB) = 1024 B
3. 1 Megabyte (MB) = 1024 KB
4. 1 Gigabyte(GB) = 1024 MB
5. 1 Terabyte(TB) = 1024 GB

Prepared by Wong Yik Pok 4E 16 9


ICT Compulsory Part 1

Word
~ The word length (word size) is measured in bits. Modern computers usually have a word
16, 32 or 64 bits.

The Greek alphabet comprises 24 letters, which has been used to represent the Greek
language for more than a thousand years. What is minimum number of bits to represent
this set of letters?

A. 3
B. 4
C. 5
C
D. 6

Hints: 2? = 24
24 = 16, 25 =32, …
As 32 > 24 ® The correct answer is C
Then 25 > 24 > 24. The minimum number of bits required is 5.

Word Minimum Unsigned binary Maximum Unsigned binary


length Integer allowed Integer allowed
4-bit 00002 1111 2
= 010 = 1510
8-bit 0000 00002 1111 1111 2
= 010 = 25510
16-bit 0000 0000 0000 00002 1111 1111 1111 11112
= 010 = 65, 53510
24-bit 0000 0000 0000 0000 0000 00002 1111 1111 1111 1111 1111 11112
= 010 = 166,777,21510

Prepared by Wong Yik Pok 4E 16 10


ICT Compulsory Part 1

Sign-and-magnitude
~ The sign bit is set to 0 for a positive integer while it is set for 1 for a negative integer.
Word Minimum signed binary Maximum signed binary
length Integer allowed Integer allowed
4-bit 11112 01112
= -710 = 710
8-bit 1111 1111 2 0111 11112
= -12710 = 12710
16-bit 1111 1111 1111 11112 0111 1111 1111 11112
= -32,76710 = -32,76710
24-bit 1111 1111 1111 1111 1111 11112 0111 1111 1111 1111 1111 11112
= -8,388,60710 = -8,388,60710

Two ‘s complement
~ It is widely used in computer to represent binary integer.
~ All integers have unique representations.
Two’s 0111 0110 0101 0100 0011 0010 0001 0000
complement
Decimal Value 7 6 5 4 3 2 1 0

Two’s 1111 1110 1101 1100 1011 1010 1001 1000


complement
Decimal Value -1 -2 -3 -4 -5 -6 -7 8

Evaluate the two’s complement representation of -1310 in an 8-bit memory unit.


8-bit binary representation of 1310 = 0000 11012
One’s Complement of -1310 = 1111 00102
Two’s Complement of -1310 = 1111 00112

Prepared by Wong Yik Pok 4E 16 11


ICT Compulsory Part 1

Evaluate the denary value of the following 8-bit two’s complement representation.
1100 00112
One’s Complement of -1310 = 0011 11002
Two’s Complement of -1310 = 0011 11012
The denary magnitude of 1100 00112= 6110

The denary value of the negative number is -6110

Calculate 10102 + 11102


1010
+ 1 1 11 11 0
11000
\ 10102 + 11102 = 110002

Calculate DE16 + AB16


D E
+ A1 B E16 + B16 = 19
1 8 9 D16 + A16 + 116 = 18
\ DE16 + AB16= 18916

Calculate A716 - 6916


Calculate 110102 - 11012
A 17
11 110 110 - 6 9 1716-916= E
3 E A16-616-116= 3
- 1101
\ DE16 + AB16= 3E16
1101
\ 110102 - 11012= 11012

Prepared by Wong Yik Pok 4E 16 12


ICT Compulsory Part 1

Chinese Character Coding Systems


The standard ASCII can have 128 characters and the extended ASCII can
have 256 characters.

Big5 Code 大五碼

~ Mainly used in traditional Chinese

Guo Biao code (GB Code) 國標碼

~ Mainly used in simplified Chinese

Unicode 統一碼
~ Support both simplified Chinese and traditional Chinese.

Past Exam Question from THMSS

ai) Unicode. As Unicode support both simplified Chinese and traditional Chinese

aii) Because the APP may not support Unicode.

Prepared by Wong Yik Pok 4E 16 13


ICT Compulsory Part 1

Ch.6 Word processing


Introduction to Word Processors
~ Also known as word processing software.
~ It allows you to create, edit, format, save and print documents.
Examples of word processing software:
1. Microsoft Word
2. Pages
3. OpenOffice.org Writer
4. WordPerfect

]]

Microsoft Word Pages

What is the advantage of word processor over a traditional typewriter?


~ It is easier and faster to create a document with the formatting features and
predefined templates provided by the word processor.
~ Documents can be saved in a digital form. They can be easily transferred and modified at
any time. It saves time, space and cost in managing and producing electronic documents.
~ Features such as Grammar checker which improves the accuracy and productivity of the
document.

Prepared by Wong Yik Pok 4E 16 14


ICT Compulsory Part 1

Finding and Replacing


~ The find command allows users to search for text in the document.
~ The replace command allows user to replace a specific text with another.

The figure shows find “button” and replace with “command”

State three ways to delete certain text in a document.


~ Select the text and then press the ‘Delete’ key.
~ Select the text and then press the ‘backspace’ key.
~ Select the text and then click the ‘Cut’ button .

Formatting features
Formatting is the process of modifying the appearance of a document, including text
attributes and text arrangement.

1. Set the paragraph layout

2. Change the alignment of the paragraph

Prepared by Wong Yik Pok 4E 16 15


ICT Compulsory Part 1

3. Modify the text attributes

4. Insert and format graphics

5. Organize text and graphics with text frames, table

Table
Click Insert -> Click Table -> choose the size you need

Blue: Column
Red: Row

Column
~ improve the readability of a passage
Click ‘Layout’ tab -> Click “columns” button
-> Select the number column required from the column gallery.

Prepared by Wong Yik Pok 4E 16 16


ICT Compulsory Part 1

Table of content
Click the References tab -> Click the Tables of contents buttons

Footnotes1
Click Reference tab -> Click insert footnote button -> Enter the footnote

Spelling and grammar checker


~ Check the spelling of words in the document.

Mail Merge
~ Personalize a generic document with name and contract information from an internal data
source.

1
Footnotes are short text messages that are used to comment or explain a source of the main text in a document.

Prepared by Wong Yik Pok 4E 16 17


ICT Compulsory Part 1

Ch. 7 Spreadsheet
~ It is a computer file created by spreadsheet which allows users to input and organize
data, create chars, and perform data analysis.

AutoFill
~ It allows users to create a series of values based on the value of one or more selected
cells adjacent to each other.

AutoFill function
Select the range of A1 to A4 -> Move the cursor downward to the cell you want.

You may find that the information of A1 to A4 are copied and pasted into the cell range A5
to A12.

Prepared by Wong Yik Pok 4E 16 18


ICT Compulsory Part 1

Formula and Cell Reference


Question 1 Find out result of the following formular
1. = 20+1
2. =20&1
3. ="App"+" _le" (error)
4. ="App"&" _le"

Relative cell reference


~ It is formed by a column letter and a row number.

What is the formula used in D2? (relative cell reference)


= A1 * B2

If I copy and paste cell D2 to D4, what is the result and the formula?
= A4 * B5
Result is 2 * 500 = 1000

Absolute Cell Reference


~ Both column letter and row number have a symbol “$”.
~ No matter how the formula copy and paste, the result will remain unchanged.

Prepared by Wong Yik Pok 4E 16 19


ICT Compulsory Part 1

Mixed Cell Reference


~ Either column letter or row number have a symbol “$”.

The formula of D2 is =$A5*B$3, so find what is the result and formula on cell D1 and E3
respectively?
D1: The result is 600. The formula is =$A4*B$3
E3: The result is 0. The formula is =$A6*C$3

Activity 3





Find the formula of B8
=(A8*(1-B7)-B3)/B3*100%

Then copies the formula in cell B8 to E11. Does it deliver the expected result? Explain your
answer briefly and correct the formula if necessary.
No. The correct formula is: =($A8*(1-B$7)-$B$3)/$B$3*100%

Prepared by Wong Yik Pok 4E 16 20


ICT Compulsory Part 1

Statistical Function
1. MAX (<range>) 從指定範圍中找到最大的數值/ MIN (<range>) 從指定範圍中找到最小的數值
For example: =MAX (A1:A10) / =MIN (A1:A10)

From the above figure, you can see the maximum number from cell A1 to A10 is 34 and the minimum
number from cell A1 to A10 is 1.

2. AVERAGE (<range of cells>) 平均数


For example: =AVERAGE (A1:A5)

3. LARGE (<range of cells>, k) / SMALL (<range of cells>, k) kth largest value/ kth smallest value
For example: =LARGE (A1:A5,2) / =SMALL (A1:A5,2)

MODE (<range of cells>) -> SAME NUMBER

Prepared by Wong Yik Pok 4E 16 21


ICT Compulsory Part 1

Past Exam Question from THMSS

a) So Easy. The answer is you guess😑


Ans: =AVERAGE (E2:E132)

b) =IF (COUNTIF (E2:G2,">=50")>=2,"pass","fail")

(COUNTIF (E2:G2,">=50") : 計算 E2 到 G2 之間有多少個大於等於 50

IF: 如果大于五十的超过两个, 出 pass, 如果没有, 出 fail.

c) =IF(AND(H2="pass", F2>E2,G2>F2),"YES","")

Prepared by Wong Yik Pok 4E 16 22


ICT Compulsory Part 1

Mathematical Functions
1. SUM (<range of cells>) 指定範圍之和
(No Example here) Sorry!

2. =SUMIF (<cell ranges>, <criterial>, <sum range>)


Question

What is the formula of Total marks?


=SUMIF (B2:B9,"=A",C2:C9)
What is the formula of No. of group member?
=COUNTIF (B2:B9,"=A")
What is the formula of group average?
=AVERAGEIF (B2:B9,"=A",C2:C9)

ROUND () 四舍五入 / INT() 向下舍入

Prepared by Wong Yik Pok 4E 16 23


ICT Compulsory Part 1

Creating Charts
Year Operating income net profit after tax
2011 652.25 140.13
2011 1082.49 259.13
2012 1512.73 417.33
2013 1942.97 370.37
2014 2373.21 395.1
2015 2803.45 533.94
2016 3233.69 456.87
2017 3663.93 483.51
2018 4094.17 595.31
2019 2601.74 552.56
2020 2745.15 574.11

Apple Inc.
(Unit: US$ 100 million)
4500

4000

3500

3000

2500

2000

1500

1000

500

0
2011 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
Operating income 652.25 1082.49 1512.73 1942.97 2373.21 2803.45 3233.69 3663.93 4094.17 2601.74 2745.15
net profit after tax 140.13 259.13 417.33 370.37 395.1 533.94 456.87 483.51 595.31 552.56 574.11

Click Insert -> Select the chart data -> Click the column in the chart group

Prepared by Wong Yik Pok 4E 16 24

You might also like