elkins school district · 3.the binary number system • only requires two numbers: 0 and 1 – for...

18
Elkins School District Alternate Method of Instruction (AMI) AMI Day #4 School Name Elkins High School Teacher Name Mrs. Hutson Subject / Course Name Computer Science Assignment Description ONLINE: Go to our Google Classroom and complete the Principles of Computer Science Part 2. PAPER HARD-COPY: Complete the worksheet using the PowerPoint. Contact Information PHONE/TEXT: (if teacher wants to give out this information EMAIL ADDRESS: ahutson@elkinsdistrict.org OTHER: (maybe website, google, remind app, etc.) Assignments will be graded and entered into the gradebook according to the teacher’s grading system. Attendance will be recorded based upon completion of the assignment.

Upload: others

Post on 11-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

ElkinsSchoolDistrict

AlternateMethodofInstruction(AMI)

AMIDay#4

SchoolName ElkinsHighSchool

TeacherName Mrs. Hutson

Subject/CourseName ComputerScience

AssignmentDescription ONLINE:GotoourGoogleClassroomandcompletethePrinciples of Computer Science Part 2.

PAPERHARD-COPY:CompletetheworksheetusingthePowerPoint.

ContactInformation PHONE/TEXT:(ifteacherwantstogiveoutthisinformation

EMAILADDRESS:[email protected]

OTHER:(maybewebsite,google,remindapp,etc.)

Assignmentswillbegradedandenteredintothegradebookaccordingtotheteacher’sgradingsystem.Attendancewillberecordedbaseduponcompletionoftheassignment.

Page 2: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 4

Data Representation & Algorithm Segment 1. Data• Is information processed or stored by a computer• Can be in the form of figures, texts, _____________ or other types of

information• Is stored and processed within a computer in _____________ format• Can be transferred from one computer to another

Page 3: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 5

2. Data Representation• Involves using binary code to represent data inside the computer• Can be:

– numbers– _____________– graphics

3. The Binary Number System• Only requires two numbers: 0 and 1

– for example, the binary number1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____________

4. The Binary System

5. Hexadecimal Numbers• Are used on webpages to _____________ colors• Are in the range of 00-FF (0-255 in decimal)

– there are 16 hexadecimal _____________, they are the same asthe decimal digits up to 9, but include the letters A-F instead of thedecimal numbers 10-15

Page 4: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 6

6. Counting Hexadecimal Numbers • Includes:

– when a number reaches F, it goes one digit to the _____________ and starts back at 0 and every digit is _____________ times bigger

– example: • what is the decimal value of the hexadecimal number A37F?

40,960 + 768 + 112 + 15 = 41,885

7. Text • Is composed of characters

– each character is allocated its own binary code – around 80 characters are used in _____________ text, including:

• 26 upper case letters • 26 lower case letters • 10 digits (0-9) • around 20 _____________ marks

8. Standard Codes • Are codes allowing text to be _____________ between different

computers • Most commonly used are:

– ASCII (American Standard Code for Information Interchange) – _____________

9. ASCII • Is a 7 bit code allowing 128 (0-127) characters, including:

– 96 _____________ characters • examples include:

– code 40 = @ – code 90 = Z

– 32 control characters which control the display devices • examples include:

– code 32 = space – code 8 = _____________

Page 5: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 7

10. ASCII • Can also be extended to 8 bit and allows 258 different characters. The

extended code is known as extended ASCII • Was originally designed to cope only with Western based character

sets such as English, _____________ and German – extended ASCII allows characters in _____________ languages

such as Arabic symbols

11. Unicode • Is a standard code providing a unique number for every character • Uses a 16 bit code for each character, which provides 216 = 65,536

characters • Can display many more characters than _____________ • _____________ more space than ASCII 12. Graphics • Can be represented in several ways, including:

– _____________ representation – _____________ graphic representation

13. Bit-Mapped Graphics • Are displayed as a _____________ of pixels

– the color of each pixel is represented by a binary code – the more pixels in the image the _____________ the resolution

Resolution: the number of pixels in the width and height of the image

Page 6: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 8

14. Bit Depth • Refers to the number of bits needed to display the color of each pixel

– each _____________ needs its own code – the higher the bit depth, the more _____________ can be

displayed, thus the higher quality of image • a 4 bit code (24 = 16) can represent a 16 color image • a 8 bit code (28 = 256) can represent a 256 color image • a 16 bit code can represent a 65,536 color image • a 24 bit code can represent a 16 million color image

15. Size of an Image • Depends on the resolution and bit depth

– for example: • the resolution of an image is 800 * 600 = 48000 pixels, the

bit depth is 24 bits; the file size is 48000 * 24 = 11520000 bits / 8 = 1440000 bytes / 1024 = 1406.25 KB = 1.4 MB

• Determines the _____________ of the image – the bigger the size, the _____________ the image and the more

space it requires 16. Vector Graphics • Are creations of _____________ images which are comprised of paths

instead of dots – a path can be a line, a square, a _____________ or a curvy

shape • Can be scaled to a larger size and not lose any image quality 17. Vector Graphics • Advantages include:

– an image created at a particular _____________ can still keep high quality in a higher resolution device

– file size is often smaller because values do not have to be held for every pixel

– objects can be _____________ to create larger objects

Page 7: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 9

18. Vector Graphics • Disadvantages include:

– individual pixels cannot be edited – it is difficult to represent _____________ shapes because

computers depict images mathematically – monitors and printers require a vector graphic to be converted into

a _____________ image before it can be displayed through a process called rendering

19. Algorithms • Are formulas which gives instructions for the computer to perform a

specific task • Can be a simple or a _____________ procedure

– can be designed to tell a computer to do a _____________ math calculation or it can be designed to tell a computer to provide the latest sales report

20. Algorithm Example • Sum of the integers from 10 to N

– sum ← 0 – x ← 10 – while x ≤ n do – sum ← sum + x – x ← x +1 – end _____________ – _____________ sum

21. A Computer Task • Can be performed in multiple algorithms

– each _____________ has its advantages and disadvantages and programmers usually seek to find the fastest and most efficient algorithm

• for example: – a person can choose different paths from work to

home− one might be the shortest, one might be the fastest and the other one _____________ highways

Page 8: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 10

22. Flow Charts • Are a _____________ representation of the step-by-step instructions

of how the computer _____________ data • Shows how an algorithm works to make the computer perform a

certain task 23. Flow Charts • Are usually created by programmers before writing a program • Show programmers different algorithms before creating a program • Use boxes of different _____________ which indicate different types of

instructions • Help programmers pay attention to the _____________ of solution to

the problem 24. Flow Chart Example • Sum of the _____________ from 10 to N

25. Linear Algorithms • Are a set of computer instructions following down a _____________,

one item at a time, without jumping among the items • _____________ to solve a problem in a step-by-step matter

Page 9: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 11

26. Linear Algorithm Flowchart Example

27. Iterative Algorithms • Are a set of computer instructions which _________ steps in iterations • Aim to find _____________ approximation in sequence in order to

solve a problem 28. Iterative Algorithm Flowchart Example

29. Software Development • Is a process of computer programming, _____________, testing and

big fixing through successive phases in an orderly way • Includes not only the actual writing of code, but also the preparation of

objects, the planning of what is to be _____________ and the approval of the final results

Page 10: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 12

30. Software Development • Involves:

– requirements analysis • determining project approach, _____________ and

anticipated final outcomes – software design

• producing several designs of the product based on the requirements _____________ during the first stage

– coding and implementation • implementing the design and producing the code

– it is the longest part of the software development process

31. Software Development • Involves:

– testing • examining the code based on the customer’s requirements

to _____________ the code works according to specifications

– deployment • delivering the product to the customer after the code is

tested – maintenance

• conducting maintenance of the software if the customer experience _____________ issues

32. Software Development • Involves choosing the appropriate computer language for the project

– script languages, such as _____________, are most suitable for small tasks or acts as a program goes between other large programs

– Visual Basic is most _____________ for new programmers – Java, C++, or comparable languages like Python and Tcl are most

suitable for larger applications using object orientation as a design model

Page 11: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

Principles of Computer Programming -Student Notes

 Accompanies: Principles of Computer Programming 13

33. Software Development • Involves choosing the _____________ computer language for the

project – C is most suitable for projects which are required to perform

efficiently – _____________ languages are most suitable for the programs

which are relatively short and high performance is required

 

Page 12: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

12/10/17

4

19

Compiler• Is a computer program which translates a

series of high-level language codes into a separate series of machine language codes

• Takes two steps to convert the codes – first, the compiler converts the entire source

code into machine language– the compiler then stores the machine language

codes in a separate file, known as an executable file

20

Interpreter • Is a computer program which converts the

source code into machine language one line at a time

• Is less frequently used compared to the complier

• Uses a different converting process than the compiler – an interpreter converts source code into

machine language but store the codes in the computer’s memory. Once the computer turns off, the machine language codes are lost

21

Data Representation & Algorithm

22

Data • Is information processed or stored by a

computer• Can be in the form of figures, texts, images

or other types of information• Is stored and processed within a computer

in binary format• Can be transferred

from one computer to another

23

Data Representation• Involves using binary code to represent data

inside the computer• Can be:

– numbers– text– graphics

24

The Binary Number System• Only requires two numbers: 0 and 1

– for example, the binary number1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in decimal

27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1

Page 13: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

12/10/17

5

25

The Binary System1 byte 8 bits

1 Kilobyte 1024 bytes

1 Megabyte 1024 Kilobytes

1 Gigabyte 1024 Megabytes

1 Terabyte 1024 Gigabytes

26

Hexadecimal Numbers• Are used on webpages to set colors• Are in the range of 00-FF (0-255 in decimal)

– there are 16 hexadecimal digits, they are the same as the decimal digits up to 9, but include the letters A-F instead of the decimal numbers 10-15

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

0 1 2 3 4 5 6 7 8 9 A B C D E F

27

Counting Hexadecimal Numbers• Includes:

– when a number reaches F, it goes one digit to the left and starts back at 0 and every digit is 16 times bigger

– example: • what is the decimal value of the hexadecimal

number A37F?

40,960 + 768 + 112 + 15 = 41,885

A 3 7 F10*163 3*162 7*16 1540,960 768 112 15

28

Text• Is composed of characters

– each character is allocated its own binary code– around 80 characters are used in Western text,

including:• 26 upper case letters• 26 lower case letters• 10 digits (0-9)• around 20 punctuation marks

29

Standard Codes• Are codes allowing text to be transferred

between different computers• Most commonly used are:

– ASCII (American Standard Code for Information Interchange)

– Unicode

30

ASCII• Is a 7 bit code allowing 128 (0-127)

characters, including:– 96 displayable characters

• examples include:– code 40 = @– code 90 = Z

– 32 control characters which control the display devices• examples include:

– code 32 = space– code 8 = backspace

Page 14: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

12/10/17

6

31

ASCII• Can also be extended to 8 bit and allows

258 different characters. The extended code is known as extended ASCII

• Was originally designed to cope only with Western based character sets such as English, French and German– extended ASCII allows

characters in foreign languages such as Arabic symbols

32

Unicode• Is a standard code providing a unique

number for every character• Uses a 16 bit code for each character, which

provides 216 = 65,536 characters• Can display many more characters than

ASCII• Occupies more space than ASCII

33

Graphics • Can be represented in several ways,

including:– bit-mapped representation– vector graphic representation

34

Bit-Mapped Graphics• Are displayed as a matrix of pixels

– the color of each pixel is represented by a binary code

– the more pixels in the image the higher the resolution

Resolution: the number of pixels in the width and height of the image

35

Bit Depth• Refers to the number of bits needed to

display the color of each pixel – each shade needs its own code– the higher the bit depth, the more color can be

displayed, thus the higher quality of image• a 4 bit code (24 = 16) can represent a 16 color

image • a 8 bit code (28 = 256) can represent a 256 color

image• a 16 bit code can represent a 65,536 color image• a 24 bit code can represent a 16 million color

image36

Size of an Image• Depends on the resolution and bit depth

– for example:• the resolution of an image is 800 * 600 = 48000

pixels, the bit depth is 24 bits; the file size is 48000 * 24 = 11520000 bits / 8 = 1440000 bytes / 1024 = 1406.25 KB = 1.4 MB

• Determines the quality of the image– the bigger the size, the better

the image and the more space it requires

Page 15: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

12/10/17

7

37

Vector Graphics• Are creations of digital images which are

comprised of paths instead of dots– a path can be a line, a square, a triangle or a

curvy shape• Can be scaled to a larger size and not lose

any image quality

38

Vector Graphics• Advantages include:

– an image created at a particular resolution can still keep high quality in a higher resolution device

– file size is often smaller because values do not have to be held for every pixel

– objects can be grouped to create larger objects

39

Vector Graphics• Disadvantages include:

– individual pixels cannot be edited– it is difficult to represent freehand shapes

because computers depict images mathematically

– monitors and printers require a vector graphic to be converted into a bit-map image before it can be displayed through a process called rendering

40

Algorithms• Are formulas which gives instructions for the

computer to perform a specific task• Can be a simple or a complex procedure

– can be designed to tell a computer to do a simple math calculation or it can be designed to tell a computer to provide the latest sales report

41

Algorithm Example • Sum of the integers from 10 to N

– sum ← 0– x ← 10– while x ≤ n do– sum ← sum + x– x ← x +1– end while– print sum

42

A Computer Task• Can be performed in multiple algorithms

– each algorithm has its advantages and disadvantages and programmers usually seek to find the fastest and most efficient algorithm• for example:

– a person can choose different paths from work to home− one might be the shortest, one might be the fastest and the other one avoids highways

Page 16: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

12/10/17

8

43

Flow Charts • Are a graphic representation of the step-by-

step instructions of how the computer processes data

• Shows how an algorithm works to make the computer perform a certain task

44

Flow Charts• Are usually created by programmers before

writing a program• Show programmers different algorithms

before creating a program• Use boxes of different shapes which

indicate different types of instructions• Help programmers pay attention to the logic

of solution to the problem

45

Flow Chart Example• Sum of the integers

from 10 to N Sum = 0

x = 10

x ≤ N

Sum = sum + x

x = x + 1

print sum

46

Linear Algorithms• Are a set of computer instructions following

down a list, one item at a time, without jumping among the items

• Aim to solve a problem in a step-by-step matter

47

Linear Algorithm Flowchart Example

START

Read Birth Date

Display Age

CalculateAge = Current Year – Birth Date

END

48

Iterative Algorithms• Are a set of computer instructions which

executes steps in iterations• Aim to find successive approximation in

sequence in order to solve a problem

Page 17: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

12/10/17

9

49

Iterative Algorithm Flowchart Example

START

Clear Variable

What is the Web Address?

Store Variable

Is it a web address

END

Create Variable

No

Yes

50

Software Development• Is a process of computer programming,

documenting, testing and big fixing through successive phases in an orderly way

• Includes not only the actual writing of code, but also the preparation of objects, the planning of what is to be coded and the approval of the final results

51

Software Development• Involves:

– requirements analysis• determining project approach, deliverables and

anticipated final outcomes – software design

• producing several designs of the product based on the requirements gathered during the first stage

– coding and implementation• implementing the design and producing the code

– it is the longest part of the software development process

52

Software Development• Involves:

– testing• examining the code based on the customer’s

requirements to ensure the code works according to specifications

– deployment • delivering the product to the customer after the

code is tested– maintenance

• conducting maintenance of the software if the customer experience technical issues

53

Software Development• Involves choosing the appropriate computer

language for the project– script languages, such as Perl, are most

suitable for small tasks or acts as a program goes between other large programs

– Visual Basic is most suitable for new programmers

– Java, C++, or comparable languages like Python and Tcl are most suitable for larger applications using object orientation as a design model

54

Software Development• Involves choosing the appropriate computer

language for the project– C is most suitable for projects which are

required to perform efficiently– assembler languages are most suitable for the

programs which are relatively short and high performance is required

Page 18: Elkins School District · 3.The Binary Number System • Only requires two numbers: 0 and 1 – for example, the binary number 1 0 1 1 0 0 1 1 is equal to 128+32+16+2+1=179 in _____

12/10/17

10

55

References• http://cs.lmu.edu/~ray/notes/pltypes/• http://techterms.com/definition/algorithm• http://smallbusiness.chron.com/algorithms-flowcharts-

51727.html• http://www.academia.edu/4443155/Difference_Between_Algorith

m_And_Flow_Chart• http://www.slideshare.net/Shurikun/topic-1-data-representation-

2384271• http://www.mathsisfun.com/hexadecimal-decimal-colors.html

56

AcknowledgementAssistant Brand ManagerCaroline Huang-Loggains

Graphic DesignerMelody Rowell

Brand ManagerMegan O’Quinn

V.P. of Brand ManagementClayton Franklin

Executive ProducerGordon W. Davis, Ph.D.

CEV Multimedia, Ltd.© MMXVI