curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · web viewplace your...

24
NAF Principles of Information Technology Lesson 13 Introduction to Programming Teacher Resources Resource Description Teacher Resource 13.1 Concept Demonstration: Using Symbols to Write Instructions Teacher Resource 13.2 Answer Key: Computer Code Comparison Matrix Teacher Resource 13.3 Presentation and Notes: The Software Development Process (includes separate PowerPoint file) Teacher Resource 13.4 Flash Cards: Computer Programming (separate Word file) Teacher Resource 13.5 Quiz: Computer Programming Teacher Resource 13.6 Answer Key: Computer Programming Quiz Teacher Resource 13.7 Key Vocabulary: Introduction to Programming Teacher Resource 13.8 Bibliography: Introduction to Programming Copyright © 2007–2016 NAF. All rights reserved.

Upload: others

Post on 24-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information Technology

Lesson 13Introduction to Programming

Teacher Resources

Resource Description

Teacher Resource 13.1 Concept Demonstration: Using Symbols to Write Instructions

Teacher Resource 13.2 Answer Key: Computer Code Comparison Matrix

Teacher Resource 13.3 Presentation and Notes: The Software Development Process (includes separate PowerPoint file)

Teacher Resource 13.4 Flash Cards: Computer Programming (separate Word file)

Teacher Resource 13.5 Quiz: Computer Programming

Teacher Resource 13.6 Answer Key: Computer Programming Quiz

Teacher Resource 13.7 Key Vocabulary: Introduction to Programming

Teacher Resource 13.8 Bibliography: Introduction to Programming

Copyright © 2007–2016 NAF. All rights reserved.

Page 2: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Teacher Resource 13.1

Concept Demonstration: Using Symbols to Write Instructions

Stacking Cups “Program”Write the following symbols on the board and explain to students that these will be the only six symbols they will be allowed to use for this activity. For this task, they will instruct the “robot” to build a specific cup stack using only these symbols:

Go through the first cup stack example together with the class. Draw the following stack of cups on the board:

Place your stack of cups on the table where everyone can see them. Ask the class to instruct you on the first thing to do. The correct answer is “pick up cup.” When you pick up each cup, note that the cup should automatically rise above the highest cup already in the stack.

With your hand in still in the air, ask for the next move. You may have to remind the class a time or two that one step forward is only half the width of a cup.

Copyright © 2007–2016 NAF. All rights reserved.

Page 3: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Once you’ve placed a single cup, transition back to the board and challenge the class to help you write the symbols on the board so that you can “run the program” later. One possible solution looks like this:

With the program written down for the class to see, you can call on a volunteer to “run” it, or you can run the program yourself. Say the arrows out loud as you move the cups into place. For example, the program above would be pronounced:

1) “Pick up cup” “Step forward” “Step forward” “Put down cup” “Step backward”

2) “Pick up cup” “Step forward” “Step forward” “Step forward” “Step forward” “Put down cup” “Step backward” “Step backward” “Step backward” “Step backward”

3) “Pick up cup” “Step forward” “Step forward” “Step forward” “Put down cup”

After completing the “program” successfully, display another cup stack diagram and ask the students to work in pairs to create a new sequence. When they are finished, invite students to instruct you (the robot) on how to proceed.

Try one of the following cup stacks:

Copyright © 2007–2016 NAF. All rights reserved.

Page 4: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Teacher Resource 13.2

Answer Key: Computer Code Comparison Matrix

Machine Language

Source Code Assembly Code Compiled Code

Computers can read it

X X X

Programmers can read it

X X (challenging)

High-level program X X

Low-level program X X

Copyright © 2007–2016 NAF. All rights reserved.

Page 5: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Teacher Resource 13.3

Presentation Notes: The Software Development Process

Before you show this presentation, use the text accompanying each slide to develop presentation notes. Writing the notes yourself enables you to approach the subject matter in a way that is comfortable to you and engaging for your students. Make this presentation as interactive as possible by stopping frequently to ask questions and encourage class discussion.

Presentation notes

Copyright © 2007–2016 NAF. All rights reserved.

Page 6: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

In the earliest days of computing, software development was simply a single programmer writing code in order to solve a problem or computerize a process. However, today’s computer systems are so large and so complex that a team of people is commonly needed to build a successful software product.

A software development team can include product managers, project managers, systems analysts, software designers, programmers, testers, graphic designers, marketers, technical writers, and even software users like you to test the product. A set of agreed-upon principles, methods, and tools are used to coordinate the team’s efforts so that the software project meets its goals.

Presentation notes

Copyright © 2007–2016 NAF. All rights reserved.

Page 7: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

To help manage the software development process, the software development life cycle (SDLC) was created. The SDLC is an organized way to build a software system or product. Although some development teams break down the steps in the SDLC in slightly different ways, the following phases are typical:

Write the problem statement: This phase establishes a big-picture view of the intended project and determines its goals. This process may involve software users (called end users) who provide ideas for improving the project. This phase also includes conducting preliminary research to see whether the proposed solution is cost effective.

Write the requirements: This phase is for analyzing the needs of end users and translating project goals into specific, practical requirements.

Design the first version of the program: In this phase, developers describe in detail all the features and operations of the system or product to meet the needs defined in the planning phase. The design serves as a type of blueprint for the project and helps detect potential problems in the plan before programming is started. This phase often includes the creation of a prototype that shows how screens will look and how processes will flow.

Code/test/fix the first version: This phase involves the writing and debugging of code to create an alpha (first) version of the software.

Presentation notes

Copyright © 2007–2016 NAF. All rights reserved.

Page 8: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Design the next version of the program: After adjustments are made to the alpha version, a beta (second) version is designed. End users often play a key role by helping to test the system or product in this phase.

Code/test/fix the next version: In this phase, the beta code is created, tested, and fixed. At this point, an independent quality-assurance group may be employed to try to break the code. These people usually start by asking the question, “If I don’t do what the program asks, what happens?”

Deploy/maintain/evaluate the first code release and plan for the next release: After final adjustments have been made to the beta version, what is sometimes called a “gold master” is put into production (manufactured) and released to the public (or to a specific customer) for installation and actual use. Then planning begins for the next product release.

Presentation notes

Copyright © 2007–2016 NAF. All rights reserved.

Page 9: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

This process is iterative—in other words, after you complete step 7, you need to “circle back” and work through the steps again, starting with step 1. In a commercial programming organization, the process continues to iterate as long as the software product is supported in the marketplace. Rarely is a program released to the public without some undiscovered bug.

When you illustrate an iterative process, you need to be sure you show the iteration graphically. For example, if you used flowcharting to illustrate the software development process, you might draw or print an arrow starting from step 7 and going back up to step 1.

Presentation notes

Copyright © 2007–2016 NAF. All rights reserved.

Page 10: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

The following are examples of mistakes that can cause a project to fail:

• Not defining the problem statement or the project requirements clearly and accurately

• Not getting everyone concerned with the project to agree on the problem statement or project requirements

• Not adequately identifying or distributing resources among team members

• Not properly tracking the progress of the project, in terms of cost and schedule

• Not identifying or addressing potential threats to the success of the project—in other words, not gathering enough information and/or ignoring potential problems

• Iterating only once through the process—for example, not gathering customer feedback on a software product already in the field and adjusting future product plans to customer requirements

Presentation notes

Copyright © 2007–2016 NAF. All rights reserved.

Page 11: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

The following are some generally accepted tips to use when developing software:

• Be very thorough in gathering product requirements, and document them in writing. Make sure that all those involved with the project agree on these requirements.

• Break large tasks into smaller, manageable pieces, and identify deadlines for each.

• To ensure accountability from all team members, make sure that deadlines are clear and that people are required to report regularly on their progress.

• Include procedures throughout the project for monitoring and maintaining quality. This includes frequent testing. Peer review, a process used for checking work by one’s own equals or peers, is a good idea.

• Keep control of your project, but not too rigidly—change is a part of life, and that includes software development.

• After the project is completed, ask the team to reflect on the project to identify what worked well and what should have been done differently. This information can be helpful for future projects.

Presentation notes

Copyright © 2007–2016 NAF. All rights reserved.

Page 12: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

When the source code (programming instructions) for a software product is made available to users and other developers, we refer to that software as open source software.

The open source movement started because some developers thought that software products could be made better if companies and programmers worked together. Those who distribute open source software expect and encourage others to examine the source code to find problems and to make changes to improve the product. The Linux operating system and a lot of the Linux application software are examples of open source software.

The availability of open source software has influenced software development in another way. Companies who develop proprietary software (software whose source code is not publicly available) have to work a little harder to keep their share of the computer market, because people now have open source alternatives.

Presentation notes

Copyright © 2007–2016 NAF. All rights reserved.

Page 13: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Teacher Resource 13.5

Quiz: Computer ProgrammingStudent Name: ___________________________________________ Date: ___________________

Directions: Answer the following questions as completely as possible.

1. Explain the difference between a programming language and a human language.

2. Explain what source code is and who can read it.

3. What does a compiler do and why is it used?

4. Describe the difference between procedure-oriented programming and object-oriented programming. Give an example of each.

Copyright © 2007–2016 NAF. All rights reserved.

Page 14: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

5. List three questions that a programmer needs to ask when considering which programming language to choose.

6. What is Java used for and why is it a popular programming language?

7. What is an algorithm?

8. Describe the purpose of open source software.

Copyright © 2007–2016 NAF. All rights reserved.

Page 15: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Teacher Resource 13.6

Answer Key: Computer Programming Quiz1. Explain the difference between a programming language and a human language.

1. A programming language is a sequence of instructions that can be translated into actions that a computer can take. Its purpose is to write computer code. Human language is designed to communicate anything and everything, not just instructions. Also it is not created just for the purpose of making a machine work.

2. Explain what source code is and who can read it.

3. Source code is the high-level programming language written by programmers and consisting of program instructions in a form that humans can read.

4. What does a compiler do and why is it used?

5. It converts code written in a high-level language into machine code so that a computer can understand it. It does this all at one time and can locate code errors easily.

6. Describe the difference between procedure-oriented programming and object-oriented programming. Give an example of each.

7. A procedural language tells the computer how a task is done by breaking the process or actions into small subtasks. BASIC, Fortran, COBOL, C, and Pascal are examples of procedural programming. Object-oriented programming is organized around “objects” rather than actions. C++ is an example of object-oriented programming.

8. List three questions that a programmer needs to ask when considering which programming language to choose.

9. Any of the following are acceptable answers:

o What do you need the program to do? (What type of process or problem are you facing?)

o On what type of computer hardware will the program be run?

o Will the program be required to run on multiple different platforms (operating systems, processors)?

o Will the program be run directly on the computer or within a web browser?

o What kind of existing software needs to interact with the new program?

o Is the program a small program (a few dozen or a few hundred lines of code), a large program (thousands to a million lines of code), or a very large program (more than a million lines of code)?

o How experienced is the programmer?

o How “steep” is the learning curve (that is, how difficult would it be for someone not familiar with a particular language to learn to use it effectively)?

o How easy is it to make changes or find errors using a particular language?

o Will the program be made available as open source?

10. What is Java used for and why is it a popular programming language?

Copyright © 2007–2016 NAF. All rights reserved.

Page 16: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

11. Java is often used to create applications for websites that will run on the site’s web server. It’s a popular choice when developing programs that run on multiple operating systems because Java was designed so that it would never be tied to any one platform.

12. What is an algorithm?

13. An algorithm is a set of instructions explaining how to solve a problem in some abstract way.

14. Describe the purpose of open source software.

15. Programmers who distribute open source software expect and encourage others to examine the source code to find problems and to make changes to improve the product.

16.

Copyright © 2007–2016 NAF. All rights reserved.

Page 17: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Teacher Resource 13.7

Key Vocabulary: Introduction to Programming

Term Definition

algorithm A set of instructions explaining how to solve a problem. An algorithm is often illustrated using a flowchart.

assembly language Programming language that has the same structure and set of commands as machine languages but allows programmers to use symbolic representations of numeric machine code.

bug Any error in a computer program that keeps it from running as planned or as expected.

code All of the characters used to write a computer program.

command An instruction that a programmer gives to a computer via code, causing the computer to perform a specific action.

compiler A computer application that translates a high-level source program into machine instructions readable by a processor and saves it to disk. The program executes when run.

conditional statement A part of a program that most often has an if...then or if...then...else statement; for example, “If it is raining, then I’ll bring an umbrella.” In this example, the presence of rain is the condition that can change to affect the next action. If an else is included, it gives the computer two actions to perform: one if the condition is true and one if the condition is false.

execution The “performance” or “running” of a computer command.

flowchart A diagram that uses graphical symbols to illustrate the flow of steps in a process.

In software development, a flowchart is a graphical description of the logic of a computer program using standard flowcharting symbols like rectangles and diamonds.

high-level programming language

A programming language that hides the details of how the computer hardware solves a problem and is therefore easier for a programmer to use. Most high-level languages use English words (such as if and for) and mathematical symbols.

interpreter A computer program that allows programmers to enter one command at a time. After a command is entered, it is converted into machine language and executed. Interpreted programming languages differ from

Copyright © 2007–2016 NAF. All rights reserved.

Page 18: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

compiled languages in that the interpreted program does not need to be complete to run parts of it.

iterate To repeat a process.

JavaScript One of the most commonly used scripting language for use in web pages.

loop Also known as an iterator, a type of program instruction that causes a block of code to be executed many times. The for loop executes code a set number of times while other loops execute code as long as a given condition evaluates to true.

low-level programming language

A programming language that allows direct control of the computer hardware.

machine language Binary code made up of 0s and 1s; usually the result of translating a high-level language program by a compiler. Often used as a synonym for low-level programming language. A machine language program is often referred to as executable code.

object An instance of a class or type of data.

object-oriented programming (OOP)

A programming paradigm (method) that uses objects and their interactions to design applications and computer programs.

procedure-oriented programming

A programming paradigm that instructs the computer how to do a task using a series of subroutines, each of which accomplishes some subtask of the overall program. Each subroutine is described using step-by-step instructions.

program A set of computer instructions that, when put together, help to accomplish a task or function, such as creating a web page or a word processing document, or performing mathematical computations.

programmer A person who writes the code (creates the programs) to instruct a computer on what to do. Computer programmers are also called software engineers.

Python Python is an easy-to-learn, general-purpose, high-level language that has sophisticated capabilities and can operate as both a procedural and object-oriented language.

semantic error The situation in which a program executes but does not produce the results that were intended.

semantics Refers to the meaning of an informal language sentence or the logic of a formal language statement (for example, a computer program).

Copyright © 2007–2016 NAF. All rights reserved.

Page 19: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Semantics reveals the meaning of syntactically valid strings in a programming language.

source code A collection of high-level language program statements in a text file.

syntax Refers to the structure and the rules of an informal language sentence (for example, in English or Spanish) or a formal language statement.

Syntax deals with the form and structure of statements in a programming language (a formal language).

syntax error An error in the syntax of an informal or a formal language (for example, when a statement in a computer program cannot be parsed by the compiler or interpreter).

A program containing a syntax error fails execution.

variable A name that represents a value.

Copyright © 2007–2016 NAF. All rights reserved.

Page 20: curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads/shared/pr…  · Web viewPlace your stack of cups on the table where everyone can see them. Ask the class to instruct

NAF Principles of Information TechnologyLesson 13 Introduction to Programming

Teacher Resource 13.8

Bibliography: Introduction to Programming The following sources were used in the preparation of this lesson and may be useful for your reference or as classroom resources. We check and update the URLs annually to ensure that they continue to be useful.

OnlineFay-Wolfe, V. “Computer Programming.” Department of Computer Science and Statistics, University of Rhode Island, http://homepage.cs.uri.edu/faculty/wolfe/book/Readings/Reading13.htm (accessed May 27, 2016).

“Flowchart Resource Center.” EdrawSoft, http://www.edrawsoft.com/flowchart-resource.php (accessed May 27, 2016).

“JavaScript Examples.” W3Schools, http://www.w3schools.com/js/js_examples.asp (accessed May 27, 2016).

“JavaScript Tutorial.” W3Schools, http://www.w3schools.com/js/default.asp (accessed May 27, 2016).

“List of Programming Languages.” Wikipedia, https://en.wikipedia.org/wiki/List_of_programming_languages (accessed May 27, 2016).

“My Robotic Friends.” Thinkersmith (CSED), http://thinkersmith.org/TSTC/Series1/CSEDrobotics.pdf (accessed May 27, 2016).

“Object-Oriented Programming.” TechTarget, http://SearchWebServices.techtarget.com/sDefinition/0,290660,sid26_gci212681,00.html (accessed May 27, 2016).

Rebelsky, Samuel A. “Your First JavaScript Programs.” Department of Mathematics and Statistics, Grinnell College, http://www.math.grin.edu/~rebelsky/Tutorials/JavaScript/EdMedia97/Exercises/firstjs.html (accessed May 27, 2016).

“Which Programming Language Should I Learn First? [Infographic].” Carlcheo.com. http://carlcheo.com/startcoding (accessed January 31, 2018).

Copyright © 2007–2016 NAF. All rights reserved.