CSP Study Guide 2

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

DISPLAY (":") DISPLAY ("-") DISPLAY ("O") After the code runs, what is displayed?

: - O

The primary colors used in programming are Red, Green and Blue.

True

Big Data

a broad term for datasets so large or complex that traditional data processing applications are inadequate.

Cyber attacks

an attempt by hackers to damage or destroy a computer network or system.

Personally Identifiable Information (PII)

the name, postal address, or any other information that allows tracking down the specific person who owns a device

Internet Protocol (IP)

A set of rules responsible for disassembling, delivering, and reassembling packets over the Internet.

Amelie is planning a gingerbread house making workshop for the neighborhood, and is writing a program to plan the supplies. She's buying enough supplies for 15 houses, with each house being made out of 5 graham crackers. Her favorite graham cracker brand has 20 crackers per box. Her initial code: numHouses ← 15 crackersPerHouse ← 5 crackersPerBox ← 20 neededCrackers ← crackersPerHouse * numHouses Amelie realizes she'll need to buy more crackers than necessary, since the crackers come in boxes of 20. Now she wants to calculate how many graham crackers will be leftover in the final box, as she wants to see how many extras there will be for people that break their crackers (or get hungry and eat them). Which line of code successfully calculates and stores the number of leftover crackers in the final box?

extras ← crackersPerBox - (neededCrackers MOD crackersPerBox)

Functions

Functions are able to be executed and ran. They can do almost anything, such as adding two numbers, etc.

What are the rules of defining a new variable?

Must not start with a number, must only have numbers, letters, and the "_" and "$" characters, and must not be a predefined variable.

The code starts with these variables, where radius represents r and height represents h: radius ← 2 height ← 5 The built-in constant PI stores an approximation of π. Which expression correctly calculates the volume?

PI * (radius * radius) * (height / 3)

Seth is writing a dialogue engine for an emergency preparedness game. The program relies on multiple string operations: PseudocodeDescriptionCONCAT(string1, string2)Concatenates (joins) two strings to each other, returning the combined string.UPPER(string)Returns the string in uppercase. Here's a snippet of his code: yell ← "ahhhh" danger ← "fire!" emoted ← CONCAT(yell, UPPER(danger)) What value does the emoted variable store?

"ahhhhFIRE!"

Algorithm

A methodical, logical rule or procedure that guarantees to solve a particular problem.

Variables

An assignable "container" for any JavaScript data type. There are three types of assignments: "var", "let" and "const". "var" is recommended not to be used, as "let" is re-assignable and "const" is not. They may get confusing.

Communication Innovations

Inventions that aided in communications of industrial rev

Conditionals

Statements that only run under certain conditions.

Code editor

Text area used to enter code in an IDE.

Arithmetic operators

The arithmetic operators perform addition, subtraction, multiplication, division, exponentiation, and modulus operations.

while loop

a programming construct used to repeat a set of commands (loop) as long as (while) a boolean condition is true

Osian is making an online shopping comparison site. His code needs to compare the cost of two items and show the difference. The initial code looks like this: item1Cost ← 32 item2Cost ← 29 Which code successfully calculates and stores how much more expensive item1 is than item2?

costDiff ← (item1Cost - item2Cost), costDiff ← item1Cost - item2Cost, costDiff ← item1Cost + (-1 * item2Cost)

Input

Data that is entered into the computer system via an input or storage device.

console.log(message)

Displays a string and/or variable values in the debug console in App Lab.

User Interface Buttons

Buttons are press able UI features that can lead to another page, add a number, etc.

Loops

The computational concept of running the same sequence multiple times.

cookies

small computer programs left behind on your computer when you visit a website

What will happen if you type pseudocode in another language's programming environment and try to run the program?

The program will not run, because programming environments only understand the language they're built for.

User Interface

The visual elements of an program through which a user controls or communications the application. Often abbreviated UI.

Nanami is researching how much software engineers make. She's writing a program to convert yearly salaries into hourly rates, based on 52 weeks in a year and 40 hours in a week. The program starts with this code: salary ← 105000 wksInYear ← 52 hrsInWeek ← 40 Which lines of code successfully calculate and store the hourly rate?

hourlyRate ← salary / wksInYear / hrsInWeek and hourlyRate ← (salary / wksInYear) / hrsInWeek

Greg is hosting a chocolate tasting night for his friends to taste chocolate truffles. He's writing a program to help him plan the festivities. The box of chocolates comes with 35 truffles, and there will be 6 people at the party. numChocolates ← 35 numPeople ← 6 Greg is going to distribute the truffles evenly and then save the extras for himself. Which line of code successfully calculates and stores the number of extra truffles?

numExtras ← numChocolates MOD numPeople

Nikki read that it's healthy to take 10,000 steps every day. She's curious how many steps that'd be per minute, walking from 10AM to 10PM, and is writing a program to figure it out. The program starts with this code: stepsPerDay ← 10000 hoursAwake ← 12 Which lines of code successfully calculate and store the steps per minute?

stepsPerMin ← (stepsPerDay / hoursAwake) / 60, stepsPerMin ← stepsPerDay / hoursAwake / 60


Ensembles d'études connexes

NURS 495: Exam IV: DI/SIADH/CSW NCLEX q's

View Set

Ch 11 Queue Implementation, JAVA ALL QUESTIONS SET 2, Chapter 10 - Queues, Deques, and Priority Queues, Final Exam, samm

View Set

Chapter 8: Marriage and Cohabitation

View Set

Language arts// Bases of English

View Set

Chapter 39: Oxygenation and Perfusion

View Set

AP Human Geography Chapter 6 - Religion

View Set