You are on page 1of 9

AP Computer Science Principles

Big Idea 1 Part 2


Grade 9
How Program Functions…
How Program Functions…
• A program is a collaboration of program statements that performs a specific task
when run by a computer.
• A program is often referred to as Software or Application. Input 3
• A code segment refers to a collection of program statements that are part of a
program
• In summary, a computer program is made up of code segments, which themselves Task: determine if a number
are made up of statements. is even or odd

Output Odd
How Program Functions…
• A programmer can never have too many test cases.
• Collaboration is so important specially to solve Logical Errors.
• New fresh eye can easily spot unseen error.
• Complex program can be described broadly by what it does.
• Keeping a program abstract, user can focus on just using the program without knowing the details of the
program code.
• Like typing in Microsoft word.
Program Input. . .
• A programs run on inputs, which are pieces of data that a computer takes
in and processes. For example, the two numbers you need to add in an
adding program are the inputs for that program.
• These inputs can be directly submitted by the user or they can come from
other programs.
• Types of Inputs:

• Auditory (ex: spoken words or music notes input into a sound processor)
• Visual (ex: photos input into a photo editor)
• Tactile (ex: strokes of a keyboard, swipes on a touchscreen)
• Text (ex: words input into a translation program or numbers input into a calculator)
Program Input. . .
• Every app is triggered in a certain way, the triggering is called an Event.
• The event is the action that supplies input data to a program.
• Events can be generated:
• Key is pressed
• Mouse is clicked
• Program started, or any action that affects the flow of execution.
Program Output. . .
• program outputs are the data that the computer returns. In the adding
program example, the program output is the final sum that the program
returns.
• Types of Outputs:
• Auditory (ex: music that plays when you press a play button)
• Visual (ex: an edited photo from a photo editor)
• Tactile (ex: a video game controller vibrating in response to in-game movement)
• Text (ex: translated text from a translation program)
Development process
• Every app is triggered in a certain way, the triggering is called an Event.
• The event is the action that supplies input data to a program.
• Events cause programs to change how they're running.
• Events can be generated:
• clicking a button
• moving a mouse
• starting a program
• pressing a key
• a timer running down to zero
Event Driven Software
• A lot of modern software is event-driven, which means that it's designed to
respond to events in order to run.

You might also like