APCSP SEMESTER 1 EXAM REVIEW
What are some of the similarities and differences between human languages and programming languages?
(computers) simply cannot handle. A programming language is composed of "code" and each action must have a precise, unambiguous meaning. A programming language is designed to communicate with a computer.
What are the benefits of creating functions?
- programs are easier to read and write - functions remove the need to repeat large chunks of code - functions break the program into logical chunks - The person programming and any other human reading the program enjoys these benefits. - Important to note: functions do not make the program easier (or harder) for the computer to run or understand - it must still run all of the same commands as before.
calculate the range of values for a binary number of a given bit size.
1 bit are numbers 0-1 2 bits are numbers 0-3 3 bits are numbers 0-7 4 bits are numbers 0-15, etc
What is the difference between lossy and lossless compression? Be able to identify which type of compression is being used in certain situations (GIF, ZIP, JPG, etc.).
1. is a data compression method that uses inexact approximations, discarding some data to represent the content. Most commonly seen in image formats like .jpg. 2. a data compression algorithm that allows the original data to be perfectly reconstructed from the compressed data.
What is the difference between a "low level" language and a "high level" language?
A "low level" programming language is 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. (i.e. assembly language). A "high level" programming languages is 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.
What is a "bug" in a program?
A bug is an issue or error in a piece of code
What is the standard "chunk size" for representing data?
A byte is the standard "chunk size" for binary information in most modern computers
What is a procedure? What is a function?
A function is a piece of code that you can easily call over and over again. In JavaScript, procedures are called functions. A procedure is the more generic programming term for a function
when to represent data as ASCII or as a number, and be able to identify how many bits the data will need.
A letter or special character on the keyboard should be represented by ASCII. Each character uses 8 bits (1 byte). Digits are represented as numbers. Use the binary number system to determine how many bits are required.
What is an IP address, and what is its purpose?
A number (123.456.789.623) assigned to any device (computer, printer, etc) that is connected to the Internet.
Why is creating a function in a program a form of abstraction?
A programmer will design a solution to a small, well-defined portion of the task and then give a name to the associated code. Whenever that problem arises again, the programmer can invoke the new function by name, without having to solve the problem again.
Can you solve small word problems that require reasoning about file sizes?
Alice has 600 MB of data. Bob has 2000 MB of data. Will it all fit on Alice's 4 GB thumb drive? Yes it fits: 600 MB + 2000 MB is 2600 MB. 2600 MB is 2.6 GB, so it will fit on the 4 GB drive no problem. Equivalently we could say that the 4 GB drive has space for 4000 MB.
What is a parameter? What are the advantages of creating functions with parameters?
An extra piece of information that you pass to the function to customize it for a specific need.
What does API stand for and what does it mean?
Application Program Interface. The full set of commands included in a programming language (e.g., every command made available by App Lab)
What are the three style aspects of a program that make it exemplar?
Camelcase: Function names are written in camelcase. This means that multi-word function names are made a single word which begins in lowercase and uses uppercase letters to indicate the start of a new word. For example: thisFunctionNameIsCamelcase() Function Definitions at Bottom: Function definitions appear at the bottom of the program. This is done so that the first line of the program is the first line of code actually run. The opposite format is also very common. Functions Names Can't Start with Numbers: In most programming languages, including JavaScript, function names are not allowed to begin with numbers or most symbols. Underscore, however, is allowed.
Explain how and why personal data is exchanged for use of free software.
Companies trade access to free tools and apps for the rights to track the data we upload to them. Advertisers develop personalized profiles of potential customers to better target advertising. Governments monitor traffic across the Internet at scales unimaginable without the use of computers. Yet we live in a world that increasingly relies on these digital tools, services and products.
What are examples of abstraction when encoding digital information?
Compression is a form of abstraction
convert between decimal, binary, and hexadecimal numbers.
Decimal = 21 (2x10 + 1x1 = 21 base 10) Binary = 10101 (1x16 + 0x8 + 1x4 + 0x2 + 1x1 = 21 base 10) Hexadecimal = 15 (1x16 + 5x1 = 21 base 10
convert between decimal, binary, and hexadecimal.
Decimal = 21 (2x10 + 1x1 = 21 base 10) Binary = 10101 (1x16 + 0x8 + 1x4 + 0x2 + 1x1 = 21 base 10) Hexadecimal = 15 (1x16 + 5x1 = 21 base 10)
Determine the difference between encryption and decryption.
Encryption is a process of encoding (converting) messages to keep them secret, so only "authorized" parties can read it. Decryption is a process that reverses encryption, taking a secret message and reproducing the original plain text.
What are considerations when deciding on a type of file compression?
File size and speed of transmission
Be able to determine the issues with a segment of code.
Finding the issues in a block of code is to find the bugs in the code. Debugging is the process of correcting an error (bug) in the code.
how the layers of protocols allow the Internet to function.
HTTP like DNS is an ASCII-text based protocol - it's just two computers sending text messages to each other. What makes it a protocol are the rules of the "conversation" the two machines are having. In the case of HTTP, it is a call-and-response protocol for a client/server relationship, where a client requests a web page or other content (image, sound, video, etc.) from a server. The server looks for it and sends it back. HTTP is a "high level" protocol that sits on top of all the other protocols and internet systems. HTTP doesn't have to worry about anything other than the text protocol of HTTP works. The network software and devices on your and others' computers handle looking up addresses, breaking down data, packeting, routing, transmission and interpretation and reassembly.
the differences between IPv4 vs. IPv6.
IPv6 is the sixth revision to the Internet Protocol and the successor to IPv4. It functions similarly to IPv4 in that it provides the unique, numerical IP addresses necessary for Internet-enabled devices to communicate. However, it does sport one major difference: IPv6 utilizes 128-bit addresses, but IPv4 only uses 32-bit addresses.
In binary, what is common with all odd numbers? With all even numbers?
If a decimal number is odd, when it is represented in binary the rightmost position will be a 1. If a decimal number is even, when it is represented in binary the rightmost position will be a 0.
What is IETF? Who comprises its membership?
Internet Engineering Task Force. develops and promotes voluntary Internet standards and protocols, in particular the standards that comprise the Internet protocol suite (TCP/IP).
What is a bit?
It is the single unit of information in a computer, typically represented as a 0 or 1.
How do you design a solution for a problem so that it is programmable?
Keep in mind the capabilities of the programming language when designing the solution.
convert between the different units of measure (kilobytes, megabytes, gigabytes, terabytes, petabyte, Exabyte)
Kilobyte - 1,024 (210) bytes, or approximately 1,000 bytes. Megabyte - 220 bytes, or 1,000 kilobytes. Gigabyte - 230 bytes, or 1,000 megabytes. Terabyte - 240 bytes, or 1,000 gigabytes. Petabyte - 250 bytes, or 1,000 terabytes. Exabyte - 260 bytes, or 1,000 petabytes.
Explain some of the privacy and economic tradeoffs involved in the collection and use of personal data.
Most companies make great efforts to balance between utility and privacy, but the issues can be tricky and raise confounding ethical dilemmas. Most of these companies and organizations (the ethical ones) have a clear, well-written privacy policy.
What are reasons for messages being dropped on the internet?
Packet loss occurs when one or more packets of data travelling across a computer network fail to reach their destination. Packet loss is typically caused by network congestion. Packet loss is measured as a percentage of packets lost with respect to packets sent.
What are privacy concerns that arise through the mass collection of data?
People might be identified when combining multiple pieces of data
Be familiar with Google Trends and how it is used to analyze web searches.
Public web facility, based on searches, that shows how often a particular search-term is entered relative to the total search-volume across various regions of the world, and in various languages.
What is the difference between screen resolution and density?
Screen Resolution is the number of pixels and how they are arranged vertically and horizontally, (1080p x 720p). Pixel Density is the number of pixels per a given area (i.e. PPI = pixels per inch).
Can you identify sequencing, selection, and iteration in a program?
Sequencing is the application of each step of an algorithm in the order in which the statements are given. Selection uses a Boolean condition (a TRUE/FALSE condition) to determine which of two parts of an algorithm is used. Iteration is the repetition of part of an algorithm until a condition is met or for a specified number of times.
Can you use appropriate terminology when describing the size of digital files?
The 8-bit byte has become the de-facto fundamental unit with which we measure the "size" of data on computers, and in fact, today most computers only let you save data as combinations of whole bytes; even if you only want to store 1 bit of information, you have to use a whole byte to do it. And many computer systems will require you store even more than that. Messages sent over the Internet are also typically structured as messages with byte-offsets.
What are the properties of the Human Machine Language that make it a "low level" language?
The Human Machine Language that we developed was composed of the base commands for what we needed to do.
Be able to use parameters to provide different values as input to procedures when they are called in a program. drawIt(10); function drawIt(x) { for (var i = 0; i < x; i++) { moveForward(25); turnLeft(); } }
The following code will call a function named drawIt and loop 10 times
Explain that the Internet is a distributed global system that works on shared and open protocols.
The internet is a group of computers and servers that are connected to each other.
Explain and identify how multiple sources of data can be combined in order to uncover new knowledge or information.
Through the use of computational analysis, it is often possible to "re-identify" individuals within data, based on seemingly innocuous information. As more of our lives is digitized, questions of security and privacy become ever more prevalent.
What is DDoS and why is it harmful?
Typically a virus installed on many computers (thousands) activate at the same time and flood a target with traffic to the point the server becomes overwhelmed - doing this can render web services like DNS, or routers, or certain websites useless and unresponsive.
Analyze the personal privacy and security concerns that arise with any use of computational systems
Using computational tools, our movements through the physical and virtual world are being automatically tracked, stored, and analyzed. Cookies in our browsers keep a record of our movements on the Internet
What are examples of abstractions used in the development of internet protocols?
We often talk about how the Internet works in "layers" and this is a perfect example of abstraction on the Internet, as one layer makes use of the functionality provided by the layer below it, without worrying about the details of how this functionality is achieved. And HTTP doesn't have to worry about anything other than the text protocol of HTTP works. The network software and devices on your and others' computers handle looking up addresses, breaking down data, packeting, routing, transmission and interpretation and reassembly.
What does "The Cost of Free" mean?
We receive free goods and services (normally software), but there is a cost. Companies want some information about us that they will either use internally or they will sell it to other companies who are interested in contacted us.
What is Big Data?
a broad term for datasets so large or complex that traditional data processing applications are inadequate
What is a library (in regards to programming)
a collection of commands / functions, typically with a shared purpose (e.g., a library of functions for manipulating the turtle).
What is API documentation?
a description of the behavior of a command, function, library, API, etc.
Be able to use a "top-down" problem-solving approach to identify sub-tasks of a larger programming task.
a design process used to start at the overall design of the function, and to continually break it down into sub-functions until you reach primitive commands
What is a raster image?
a dot matrix data structure, representing a generally rectangular grid of pixels, or points of color, viewable via a monitor, paper, or other display medium. Raster images are stored in image files with varying formats.
Callback function
a function specified as part of an event listener; it is written by the programmer but called by the system as the result of an event trigger.
What is a cookie and what purpose does it have? What is a third-party cookie?
a message given to a Web browser by a Web server. The browser stores the message in a text file. The message is then sent back to the server each time the browser requests a page from the server. The main purpose is to identify users and possibly prepare customized Web pages or to save site login information for you. Third-party cookies are cookies that are set by a website other than the one you are currently on. For example, cnn.com might have a Facebook like button on their site. That like button will set a cookie that can be read by Facebook.
What is a binary message?
a message that can only have one of two possible values.
What are routers and how do they communicate to each other?
a networking device that forwards data packets between computer networks. perform the traffic directing functions on the Internet. A data packet is typically forwarded from one router to another router through the networks that constitute the internetwork until it reaches its destination node.
What is a "for" loop?
a particular kind of looping construct provided in many languages. Typically defines a counting variable that is checked and incremented on each iteration in order to loop a specific number of times.
What is an algorithm?
a precise sequence of instructions for processes that can be executed by a computer.
What is Moore's Law and how is it relevant today?
a prediction made in 1965 that computing power will double every 1.5-2 years. It has remained more or less true ever since. With some small differences, the same is true for data storage capacity.
What is a heuristic and when should it be used?
a problem solving approach (algorithm) to find a satisfactory solution where finding an optimal or exact solution is impractical or impossible.
How does redundancy come into play on the internet? What are paths?
a process through which additional or alternate instances of network devices, equipment and communication mediums are installed within network infrastructure. It is a method for ensuring network availability in case of a network device or path failure and unavailability. As such, it provides a means of network failover. Typically, network redundancy is achieved through the addition of alternate network paths, which are implemented through redundant standby routers and switches. When the primary path is unavailable, the alternate path can be instantly deployed to ensure minimal downtime and continuity of network services.
What is a protocol? Give an example of a protocol.
a set of rules governing the exchange or transmission of data between devices. This is sometimes called a communication protocol.
how HTML is used to format text
a standardized system for tagging text files to achieve font, color, graphic, and hyperlink effects on World Wide Web pages. To bold a set of characters, plave <b> in front of the bolded text and place a </b> after it
What is the Caesar Cipher? Be able to use this encryption technique.
a technique for encryption that shifts the alphabet by some number of characters.
What is a byte?
a unit of data that is 8 bits long. A byte is the standard "chunk size" for binary information in most modern computers.
What does binary refer to?
a way of representing information using only two options.
What is the hexadecimal number system? What digits are used to represent each place? What does each place represent?
a way to write numbers using 16 digits: 0-9, A, B, C, D, E, F. A=10, B=11, C=12, D=13, E=14, F=15. It is the base 16 number system. The rightmost digit represents the one's (16^0), the next number to the left is the 16^1 position, etc.
What is the binary number system? What does each place represent?
a way to write numbers using only two digits: 0 and 1. It is the base 2 number system. The rightmost digit represents the one's (2^0), the next number to the left is the 2^1 position, etc.
What is the decimal number system? What does each place represent?
a way to write numbers using ten digits: 0-9. It is the base 10 number system. The rightmost digit represents the one's (10^0), the next number to the left is the 10^1 position, etc.
What is a Random Substitution Cipher?
an encryption technique that maps each letter of the alphabet to a randomly chosen other letter of the alphabet
Describe the ASCII encoding scheme.
codes 0-31 are "control characters" that are largely defunct and go unused; they were formerly used to control various aspects of machines and printers. 32-126 are printable characters and include the numbers 0-9, all 26 letters (both lowercase and uppercase), and many common punctuation symbols. Over time, 8 bits became a standard "chunk-size" for encoding information
What is metadata?
data that describes other data. For example, a digital image my include metadata that describe the size of the image, number of colors, or resolution
Why do we need algorithms?
developed to solve a problem. Different code can be written to implement the same procedure
Be able to create functions and call functions. Be familiar with the syntax used in Code Studio.
drawIt(); function drawIt() { for (var i = 0; i < 2; i++) { moveForward(25); turnLeft(); } }
Explain the weaknesses and security flaws of substitution ciphers
easy to crack because you can use letter frequencies to determine the most likely substitution for a character. Computational tools facilitate the process of cracking substitution ciphers.
What are some considerations when describing the "efficiency" of a program?
efficiency can mean different things, but in programming it generally means the speed that the code runs, the number of lines of code, or how much memory it uses.
What is a kibibyte and a mebibyte?
exactly 1,024 (210) bytes. The unit symbol for the kibibyte is KiB
What does it mean to be a "creative" programmer?
has to do with both the process you invent (an algorithm) to solve a new problem in a given context and how you implement that algorithm in a given language. often means combining or using algorithms you know as part of a solution to a new problem.
Be able to explain the exponential growth of data
he amount of data flying around is doubling every two years or so. Here's a way to think about how fast this is: The world will produce as much digital data over the next 2 years, as currently existed in all of humanity prior to that. And it will do the same the 2 years after that. And so on.
Why is encryption an important need for everyday life on the Internet?
is important because it allows you to securely protect data that you don't want anyone else to have access to. Without it, it would be impossible to securely conduct business and do communications over the internet.
What is a pixel? How is a pixel color represented? What does RGB stand for and how is it used to create a color? How many bits are used for RGB?
is the fundamental unit of a digital image, typically a tiny square or dot which contains a single point of color of a larger image. The pixel color uses RGB. The RGB color model uses varying intensities of (R)ed, (G)reen, and (B)lue light, which are added together to reproduce a broad array of colors. By default, 8 bits are used for each of the three colors (red, green, and blue), for a total of 24 bits. However, RGB can be stored in less or more bits when specified.
What is a bit rate for message exchange?
is the number of bits that are conveyed or processed per unit of time (e.g. 8 bits/sec). This is the amount that can be transferred during a period of time.
explain the issue of Net Neutrality.
is the principle that Internet service providers should enable access to all content and applications regardless of the source, and without favoring or blocking particular products or websites.
What are the challenges when using large amounts of data?
requires a whole new set of tools in order to handle its size and scale. The scale makes it hard to "see" sometimes, and techniques for looking at, working with, and understanding data change once the data is "big." Everything, from how it's stored to how it's processed to how it's visualized, is a little different once you enter the realm of big data.
What are packets? What are the benefits of transmitting information in packets?
small chunks of information (bits) that have been carefully formed from larger chunks of information. get routed across the internet. allow a large file to get transmitted in many small pieces and reassembled on the other end.
What does DNS stand for and what is its purpose? How is it useful? What are its vulnerabilities?
stands for Domain Name Service. translates URLs into IP addresses. can be spoofed to translate a fake website into the IP address for the real website
What is a URL? What is a domain name? What is a subdomain?
stands for Universal Resource Locator. It is an easy-to-remember address for calling a web page (like www.code.org). A domain name is the part of a network address that identifies it as belonging to a particular domain (for example: mysite.com). You could create a subdomain for pictures on your site called "pics" that is accessible through the URL pics.mysite.com in addition to www.mysite.com/pics.
explain the issue of Internet Censorship.
the attempt to control or suppress what can be accessed, published, or viewed on the Internet by certain people. This can be used to protect people (i.e. to not allow access to child pornography) but can also be used to limit free speech.
What are "primitive" commands?
the base commands that all other code is based upon.
What is the LZW compression technique and what file types use it?
the compression of a file into a smaller file using a table-based lookup algorithm invented by Abraham Lempel, Jacob Ziv, and Terry Welch. Two commonly-used file formats in which LZV compression is used are the GIF image format served from Web sites and the TIFF image format. The zip utility uses this compression scheme.
What does the term Cipher refer to?
the generic term for a technique (or algorithm) that performs encryption.
What is IP and what is its purpose?
the method or protocol by which data is sent from one computer to another on the Internet. Each computer (known as a host) on the Internet has at least one IP address that uniquely identifies it from all other computers on the Internet.
What is "collaborative problem solving"?
the process of working with others to solve a problem. This may involve splitting up the problem into multiple tasks assigned to individual people and then coming back together to discuss the results.
What is HTTP and what is its purpose?
the protocol used for transmitting web pages and other resources (such as images, documents, etc.) over the Internet
Describe bandwidth. What is used to measure bandwidth?
the transmission capacity measured by bit rate (i.e. how wide the pipe is). High bandwidth means that there is high capacity.
Can you identify and compare the size of familiar digital media (i.e. txt, docx, jpg, bmp, etc.)?
txt files have smaller files sizes than docx files when storing the same text. Jpg (lossy compression) has smaller file sizes than bmp (lossless compression)
What is a loop used for?
used to perform an action over and over again.
What is TCP and what is its purpose?
was designed to overcome the inherent unreliability of the Internet. A small but non-negligible percentage of packets are lost in transmission because of faults in the infrastructure of the Internet. In order to constrain the extent of these errors, larger messages are divided into many packets which are individually routed to their recipient. The receiving computer will send an acknowledgement confirming the receipt of that packet. If the sending computer does not receive an acknowledgement, it will resend the packet until all packets have been acknowledged.
What is the Digital Divide and how can it effect surveys?
when access to technology differs widely by personal characteristics like race, income, region, country.
What does "cracking encryption" mean?
when you attempt to decode a secret message without knowing all the specifics of the cipher
Why would you use random numbers when calling a function with parameters?
when you want to provide randomness to a function, so that each time the function is called it does not do the same thing.
How is designing an algorithm to solve a problem different from other kinds of problem solving?
you should keep in mind how it might be used in a more general sense. For example, can the problem be broken down into smaller chunks, or can parameters be used to make it work for a wider range of problems?