AP CSP Exam Creative Development (10-13%)

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

2.I5 The following are effective ways to find and correct errors

- Test cases Testing different inputs, and testing at different points in your program's runtime. Good testing procedures include testing with valid and invalid data. You want to make sure your program works with valid data and knows what to do if invalid data is imputed. You should also test boundary cases, or values on the edge of program limits. This is where errors are likely to happen. For example, if your program only accepts values less than 9, you would check 8 and 10 as boundary cases. - Hand tracing manually tracking what values your variables have as your program goes along. Many hand tracing methods use charts to organize these values - Visualizations - Debuggers (programs designed specially to test for bugs) - Adding extra output statement(s)

2.B Explain how a program or code segment functions. 2.B1 A program is a collection of program statements that performs a specific task when run by a computer.

A program is often referred to as software.

2.F2 AP CSP Sample Question Eric is going to write a program for the math teachers at his school that will help them keep track of book numbers across the department. Before he can begin planning this program, what vital information will he need? Select Two (answers in blue)

Any concerns that the teachers have about how the program will work. --> Helps in discovering the goal and what the program will need to do. How many teachers are in the math department --> Not apart of the investigation phase What algorithms he will need in order to create the program. --> Not apart of the investigation phase A description of what the user interface should look like and how the teachers will interact with the program. --> Helps in discovering the goal and what the program will need to do.

2.I2 A syntax error is a mistake in the program where the rules of the programming language are not followed.

Any typos in your code, such as forgetting to close a parentheses or spelling a variable wrong, will cause an error. This is usually the easiest error to correct. Most programs will direct you to line where the mistake was made. Line 1: PROCEDURE mystery(a, b) Line 2: { Line 3: DISPAY (a+ b) Line 4: }" A syntax error would result from this on line 3 because the abstraction DISPAY does not exist. There would be no error if it was spelled correctly and said DISPLAY. common syntax errors are forgetting to include... colon / semicolon parenthesis curly braces indenation quotes variable definition

2.C Identify input(s) to a program. 2.C1 Program inputs are data sent to a computer for processing by a program. Input can come in a variety of forms, like

Auditory, such as spoken words or music notes Visual, such as photos or videos Tactile, such as strokes of a keyboard Text, such as words or numbers

1.A4 Collaboration that includes diverse perspectives helps avoid

BIAS in the development of computing innovations

2.F7 The design phase may include:

Brainstorming planning and story-boarding organizing the program into modules and functional components creating diagrams that represent the layouts of the user interface developing a testing strategy for the program

1.A2 A computing innovation can be NON-PHYSICAL

Computing software such as... Picture Editing Software (Photoshop/Adobe Lightroom) Word Processors (Word/Pages/Google Docs) Communication platforms (email/text messaging/video conferences) Digital video games (Dark Souls/Minecraft/Super Mario Kart) Applications (iPhone Apps) BUT ALSO non-physical computing concepts such as... E-commerce Social networking

1.A3 Effective collaboration produces a computing innovation that reflects the

DIVERSITY of talents and perspectives of those who designed it.

2.E4 Programs can be developed using both of these models (incremental and iterative), or any combination of the two

For example, you can take a code segment of a larger program and revise it until you finish developing it completely, then move on to another part of the program. You're using an iterative process by revising that code segment to completion, but an incremental one for the program at large.

2.C2 An event is associated with an action and supplies input data to a program.

In order for a program to receive inputs, an event needs to happen. An event is simply an action that gives a program data to respond to. For example, pressing the left arrow causes a video game's program to make an avatar go left when before this it was running right. Pressing the key is the event in this case. Events cause programs to change how they're running. In the previous example, pressing the left key caused a change. If the arrow hadn't been pressed, the avatar would've kept running right.

2.D Identify output(s) produced by a program 2.D1 Program outputs are any data sent from a program to a device.

Just like inputs, program output can come in a variety of forms, such as tactile, audio, visual, or text. If program inputs are data that a computer takes in, program outputs are the data that the computer returns. They can be in any of the formats that inputs can be.

2.B5 You can also go more in depth by describing how the program's statements accomplish this goal.

My adding program asks the user to input two numbers, then adds them together and displays the final sum.

2.B5 A program can be described in a broad sense by what it does.

My adding program lets the user add two numbers of their choice.

2.F6 The design phase of the development phase details how to accomplish the goals of the program.

Or in other words, how to accomplish a given program specification.

1.B2 The computer science field has several models designed to foster collaboration, such as

PAIR PROGRAMMING a programming model where two people share one computer. One person codes while the other person oversees the work, and the two often switch places.

1.B Computing innovations are developed by who?

PEOPLE specifically teams and groups of people

2J Identify inputs and corresponding expected outputs or behaviors that can be used to check the correctness of an algorithm or program. 2.J1 In the development process, testing uses defined inputs to ensure that an algorithm or program is producing the expected outcomes.

Programmers use the results from testing to revise their algorithms or programs.

2.G Describe the purpose of a code segment or program by writing documentation 2.G1 Program documentation is a written description of the function of a code segment, event, procedure, or program and how it was developed.

Programs are complex things, and when you're dealing with pages and pages of code, documentation helps you keep things straight. They also foster collaboration. Someone other than the original programmer may someday need to work with this code, and documentation helps explain what's going on.

2.A1 The purpose of computing innovations is to

SOLVE PROBLEMS or to pursue interests through creative expression.

1.A2 A computing innovation can be PHYSICAL

Self-driving cars Smart appliances (fridges/watches/toasters) Tablets (Kindles/iPads) Smart Phones Gaming devices (Nintendo Switch/Xbox) Robots (Roombas, for instance)

2I AP CSP Sample Debug Problem #1

The Problem here is that the procedure isn't actually doing anything. It returns a new value but once the procedure repeats it immediately goes back to 0. Therefore, there is no progression as it always stays between 0 and 1. You could've figured this out by using hand tracing. If you move the assignment of the count outside of the loop, which is choice C, the returned value will be used for the next loop.

2.G2 Comments are a form of program documentation written into the program.

They are to be read by people and do not affect how a program runs. Think of documentation / comments as notes for your code in the same way you'd take notes for a textbook

2.F2 Investigation in a development process is useful for understanding and identifying the program constraints, as well as the concerns and interests of the people who will use the program.

This is the game-plan stage of the development process. The goal of this investigation is to make the goal of the programmers as clear as possible. In this stage, programmers establish what their purpose is and the problem they're trying to solve. They figure out what their program will need to do, and also what their program will need in order to function properly. In order to get a clear picture during this stage, programmers have to consult with many sources. If their program is for a client, the client will be consulted to determine what they want. If they're working in a group, they may have to consult each other to make sure all parts of their program will work together. They may also have to do external research to discover what sorts of programs are similar to the one they're trying to make.

1.A5 COLLABORATION, COMMUNICATION and CONSULTATION with

USERS are important aspects of the development of computing innovations. ex. video games will have testers that check the product for bugs and report them to the developers.

2.I4 An overflow error is an error that occurs when a computer attempts to handle a number that is outside of the defined range of values.

Usually, this means that your computer's trying to handle a number too big for it.

2.F4 Through investigation, programmers are able to discover their program's requirements. Program requirements describe how a program works and may include a description of user interaction.

What should a user be able to do? What does a user need to provide for the program to work? Program requirements also include what's needed on the programmer's side (ex: the program must be compatible with multiple browsers) as well as what tests need to be run to confirm that all these requirements are in place.

2.C5 In event-driven programming, program statements are executed when triggered rather than through the sequential flow of control.

Your phone's software is event-driven as a whole because it responds primarily to your taps, clicks and swipes.

1.A1 A computing innovation includes

a PROGRAM as an integral part of its function.

2.B2 A code segment is

a collection of program statements that is part of a program.

2.A It's important to know how to describe the purpose of

a computing innovation

2.D2 Program output is usually based on

a program's input or prior state (e.g., internal values).

2.C6 Input can come from

a user or other programs

2.A2 An understanding of the purpose of a computing innovation provides developers with

an improved ability to develop that computing innovation.

2.C3 Events can be generated when a key is pressed, a mouse is clicked, a program is started, or

any other defined action occurs that affects the flow of execution.

2.J2 Defined inputs used to test a program should demonstrate the different expected outcomes that

are at or just beyond the extremes (minimum and maximum) of input data.

1.A Computing innovations are improved through

collaboration

2.F3 Some ways investigation can be performed are as follows:

collecting data through surveys user testing interviews direct observations

1.C There are effective interpersonal skills for collaboration 1.C1 Effective collaborative teams practice interpersonal skills, including but not limited to:

communication consensus building conflict resolution --> (meeting a middle ground / compromise) negotiation empathy

2.G4 Program documentation helps in

developing and maintaining correct programs when working individually or in collaborative programming environments.

2.G3 Programmers should

document a program throughout its development.

2I Identify and correct errors 2.I1 A logic error is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly.

ex of logic error: three times three equals thirty-three. or... Line 1: PROCEDURE findEven(num) Line 2: { Line 3: IF(num MOD 2 = 1) Line 4: RETURN(EVEN) Line 5: ELSE Line 6: RETURN(ODD) Line 7: } The code above has a logic error on line 3 The code num MOD 2 = 1 would evaluate to true when num is an odd number. The resulting error on line 3 would result in EVEN instead of the correct value ODD being returned logic errors are often difficult to find and correct

2.B3 A good program should work

for a variety of inputs and situations.

2.J3 Program requirements are needed to

identify appropriate defined inputs for testing.

2.E2 There are multiple development processes. The following phases are commonly used when developing a program:

investigating and reflecting designing prototyping testing

2.F Design a program and its user interface 2.F1 The design of a program incorporates

investigation to determine its requirements.

2.B4 The BEHAVIOR of a program / PROGRAM FUNCTIONALITY

is how a program functions during execution and is often described by HOW A USER INTERACTS WITH IT.

2.E4 A development process that is incremental is

one that breaks the problem into smaller pieces and makes sure each piece works before adding it to the whole.

2.E Develop a program using a development process. 2.E1 A development process can be

ordered and intentional, or exploratory in nature.

2.H2 Acknowledgement of a code segment(s) written by someone else and used in a program can be in the

program documentation. The acknowledgement should include the origin or original author's name.

1.A6 Information gathered from potential users can be used to understand the

purpose of a program from diverse perspectives and to develop a program that fully incorporates these perspectives.

2.E3 A development process that is iterative requires

refinement and revision based on feedback, testing, or reflection throughout the process. This may require revisiting earlier phases of the process.

1.B1 Online tools support collaboration by allowing programmers to

share and provide feedback on ideas and documents.

2.G5 Not all programming environments support comments

so other methods of documentation may be required.

2.H Acknowledge code segments used from other sources. 2.H1 It is important to acknowledge any code segments

that were developed collaboratively or by another source.

2.C4 Inputs usually affect

the output produced by a program

2.F5 A program's specification defines

the requirements for the program.

2.I3 A run-time error is a mistake in the program that occurs during the execution of a program. Programming languages define their own runtime errors.

this error is commonly referred to as a bug may result from... -dividing by 0 -inappropriate entered data type (user inputs number when they should've input a word Line 1: PROCEDURE mystery(list) Line 2:{ Line 3: DISPLAY(list[0]) Line 4: } A list is a data structure that can directly access an element by index. The AP language list starts on index 1 (not 0). This program is trying to access an element from a list that does not have an index in the correct range. This error of trying to access an index that is out of bounds would be discovered when running the program. This is not a logic error. A logic error is when the program runs but delivers a wrong result.


Ensembles d'études connexes

Chapter 36, 37, 43, 44, 46 Questions

View Set

STUDY GUIDE Mendelian Genetics --- Chapter 6 & 7

View Set