Ap 2

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Hexadecimal

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

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 reminiscent of a turtle.

Library

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

API

A collection of commands made available to a programmer

Documentation

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

Selection

A generic term for a type of programming statement (usually an if-statement) that uses a Boolean condition to determine, or select, whether or not to run a certain block of statements.

Function

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

Algorithm

A precise sequence of instructions for processes that can be executed by a computer

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.

Low Level Programming Language

A programming language that captures only the most primitive operations available to a machine. Anything that a computer can do can be represented with combinations of low level commands.

High Level Programming Language

A programming language with many commands and features designed to make common tasks easier to program. Any high level functionality is encapsulated as combinations of low level commands.

Abstraction

A simplified representation of something more complex, they allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.

Parameter

An extra piece of information passed to a function to customize it for a specific need

Line 3 and 4

Consider the following incorrect program, which is intended to move the robot around the perimeter of a grid, as indicated by the drawing below. The starting position and direction of the robot is indicated in the diagram. Given the options below, which lines should be removed so the program will work as intended? * 1/1 Captionless Image

Loop

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a 100 tiny dots in a line.

Function(s)

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a circle of any size at any point on the screen.

Loop

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a hexagon (six-sided shape)

Function(s)

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing out the letters of a word "HELLO"

For Loop

Loops that have a predetermined beginning, end, and increment (step interval).

Ambiguities in natural language necessiate the creation of programming languages for controlling a computer and Compared to the number of words in a natural language the number of defined words in a programming language

Programming languages have some similarities and differences to the "natural" language you use in everyday speech. Select the two true statements about programming languages.

Sequencing

Putting commands in correct order so computers can read the commands.

Loop

The action of doing something over and over again.

B

The next two questions use a robot in a grid of squares. The robot is represented as a triangle, which is initially facing up, towards the top of the grid. The robot is moved according to the following instructions. Which of the following images shows the path and ending location of the robot that will result from executing the code above. The starting location of the robot is shown as dotted triangle for cases where the robot does not start and end at the same location. * 0/1 Captionless Image

Iterate

To repeat in order to achieve, or get closer to, a desired goal.

A function name should be as descriptive as possible to indicate what the function does

What is one important naming conventions of functions?

The program will run without error but will not draw anything

What is the most likely outcome of running the code shown here

Programmers can use functions created by their partners, relying on the functionality without needing to know the specific details of how the function is implemented

When programmers work together, what is an example of how abstraction in programming can promote collaboration

Answer b

Which of the following images represents the most likely output produced by the code segment given below?

Functions cannot make calls to other functions within the same program

Which of the following is NOT true about functions in programming?

drawStar();

Which of the following will call the function drawStar?

Two functions in a single program can have different names but contain identical code

Which one of the following statements about functions is TRUE *

Parameters allow for more flexible, generalized behaviors in functions

Why are parameters useful when programming?


Kaugnay na mga set ng pag-aaral

ECON 222 Production and Growth TEST 2 BOOK

View Set

Chapter 20: Lymphatic System; 21: Immune System

View Set

ATI questions - Sensory Perception

View Set

ACCT 3303 Final Exam Review (Chapter 2)

View Set

Lab: Cervical, Thoracic, and Lumbar Vertebrae

View Set