APCSP U3 L4-7

What do you write when to call a function?

myFunction() add the function defined and add parenthesis at the end

Turtle Programming

a classic method for learning programming with commands to control movement and drawing of an on-screen robot called a "turtle". The turtle hearkens back to early implementations in which children programmed a physical robot whose dome-like shape was remi

programming language

a coding language used to dictate specific instructions to a computer

programming environment

a tool where you write and run computer programs

This lesson introduced the notion of "efficiency" in programming, and that it might mean different things at different times. Think of an example outside of computer science in which you have heard the term "efficiency" and compare it to the ways we talke

Efficiency in programming is how fast and small something is coded. Efficiency is used when also explaining how fast you can manage your time while taking tests or doing homework. Efficiency is the same in that it's both used to describe how fast in time

Abstraction

a simplified representation of something more complex. Abstractions allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.
A function or procedure is an abstraction.

Function

a named group of programming instructions. Functions are reusable abstractions that reduce the complexity of writing and maintaining programs

Top
Bottom

Top - calling functions
Bottom - function definitions

Defining vs calling a function

When you define a function you give a name to a set of actions you want the computer to perform. When you call a function you are telling the computer to run (or execute) that set of actions.

functions also known as

procedures

Choose the two (2) statements that are true about functions

Meaningful function names help people better understand programs.
Functions in programming are named groupings of programming instructions.

Which of the following is NOT a true statement about functions?

Functions cannot make calls to other functions written by the same programmer.

True statements about functions

Functions are reusable programming abstractions.
Functions help reduce the complexity of writing and maintaining programs.
Functions help break a problem into logical chunks.
Once defined, a function can be called many times from different parts of a prog

Top Down Design

a problem solving approach (also known as stepwise design) in which you break down a system to gain insight into the sub-systems that make it up.

Which of the following statements about writing functions and Top-Down Design is NOT true?

Two programmers solving the same problem using Top-Down Design should arrive at identical programs.

True about Top-Down design

Writing functions helps manage complexity in a program.
Top-Down Design leads to programs which feature multiple layers of abstraction.
Top-Down Design relies upon identifying sub-problems of a larger problem.
Top-Down Design assists in identifying the la

API

(application program interface) a collection of commands made available to a programmer

Documentation

a description of the behavior of a command, function, library, API, etc.

Hexadeximal

A base-16 number system that uses sixteen distinct symbols 0-9 and A-F to represent numbers from 0 to 15.

Library

a collection of commands / functions, typically with a shared purpose

Parameter

An extra piece of information that you pass to the function to customize it for a specific need.

what is a function parameter?

A way to give input to a function that controls how the function runs.

Draw (on paper) the simplest image you can that we would be unable to create with our "building block" commands, and explain why it would be impossible to create.

Anything with a non-90-degree angle, curved, or with different colors, cannot be done with the given set of simple commands.