CSP Study Guide

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

The code segment below uses a loop to repeatedly operate on a sequence of numbers. result ← 0 i ← 8 REPEAT 7 TIMES { result ← result + i i ← i - 1 } Which description best describes what this program does?

This program sums up the integers from 2 to 8 (inclusive).

Wynter is working on an app for learning fractions. His program uses the following procedure for string concatenation: Pseudocode: concatenate(string1, string2) Description: Concatenates (joins) two strings to each other, returning the combined string. denom ← "third" num1 ← "one" num2 ← "two" Which line of code would store the string "one-third"?

frac ← concatenate(concatenate(num1, "-"), denom)

Elvira is experimenting with assigning and displaying variables. Here's a snippet of her code: a ← 12 DISPLAY (a) b ← 32 DISPLAY (b) a ← b b ← 52 DISPLAY (a) DISPLAY (b) What will be the output of that code?

12 32 32 52

Joselyn is developing a recipes app. Here is a part of her program that sets up some variables: title ← "Mashed parsnips" prepTime ← 10 cookTime ← 30 rating ← 4.5 category ← "veggies" How many string variables is this code storing?

2

The following code snippet processes a list of strings with a loop and conditionals: words ← ["belly", "rub", "kitty", "pet", "cat", "water"] counter ← 0 FOR EACH word IN words { IF (FIND(word, "e") = -1 AND FIND(word, "a") = -1) { counter ← counter + 1 } } DISPLAY(counter) The code relies on one string procedure, FIND(source, target), which returns the first index of the string target inside of the string source, and returns -1 if target is not found. What value will this program display?

2

This program uses a nested conditional to assign the variable mystery to a value: IF (x > y) { mystery ← x - y } ELSE { IF (x < y) { mystery ← y / x } ELSE { mystery ← x + y } } If we set x to 8 and y to 24, what value will the mystery variable store after running this code?

3

When a computer wants to use public key cryptography to send data securely to another computer, those computers need to start a multi-step exchange of information. What is the first information exchanged?

The two computers send their public keys to each other

In 2016, the ACLU reported that a company called Geofeedia analyzed data from social media websites like Twitter and Instagram to find users involved in local protests and sold that data to police forces. The data included usernames and their approximate geographic locations. Geofeedia claims the data was all publicly available data. In response to the news, many users were eager to find ways to keep their geolocation private. Which of these actions is least likely to help a user keep their geolocation private?

Disabling third-party cookies in their browser

A teacher receives an email to his school address. The email claims to be from their school's learning management system and asks him to verify his account credentials. He follows a link in the email to a website with a username and password box. The website doesn't look quite right, so he suspects it might be a phishing scam. What would be the safest next step?

Follow his bookmarked link to the LMS website, and email their official support address to see if the email is real.

Andy is using machine learning for an algorithm that classifies photos of restaurant meals by category (such as "sandwich", "curry", or "salad"). He trains a neural network on a large open database of photos of restaurant meals. He then tests the network on local restaurants and notices that the Ethiopian restaurant meals aren't classified correctly. What's the best way to improve the machine learning algorithm's ability to recognize Ethiopian meals?

He can add Ethiopian meals to the training data set, by finding photos online, crowd-sourcing, or taking them himself.

How can attackers access a user account protected by two-factor authentication (2FA)?

It's possible for an attacker to break into an account secured with two-factor authentication, but only if they have access to both factors.

One way to calculate wildfire risk is to consider the temperature, humidity, and wind. Wildfire risk is elevated if the humidity is below 15%, wind speed is faster than 15 miles per hour, and temperature is greater than 50°F. The variable humidity represents the humidity percentage, the variable wind represents the wind speed (mph), and the variable temp represents the temperature in degrees Fahrenheit. Which of the following expressions evaluates to true if there is an elevated wildfire risk?

NOT(humidity ≥ 15) AND wind > 15 AND temp > 50

Annalee is setting up a research lab. She wants to be able to search the Web from her laptop anywhere in the lab but doesn't want to drag an Ethernet cable around the lab. Annalee starts browsing online for products. Which of the following products should she buy?

NetGear Wireless Access Point

If a website wants to track which pages a user visits on their website, what is required technically?

None of the above

The Griffin family lives in multiple states, so they decide to use an online collaborative website to create their annual photo book. The website lets each of them upload photos from their computer, and then they can all arrange the photos into pages. What valid privacy concerns might the family members have?

One of the family members could accidentally upload a photo that others did not want to be shared.; The company that created the website now has a copy of the family's personal photos on their web servers.

Joline is writing code to calculate formulas from her electrical engineering class. She's currently working on a procedure to calculate electrical resistance, based on this formula: Which of these is the best procedure for calculating and displaying resistance?

PROCEDURE calcResistance (voltage, current) { DISPLAY (voltage/current) }

Lillie is writing a program that calculates geometry formulas. Her procedure calcDistance should return the distance between two points, based on the Pythagorean distance formula: This is the code of the procedure with line numbers: PROCEDURE calcDistance (x1, y1, x2, y2) { xDiff ← x2 - x1 yDiff ← y2 - y1 sum ← POW(xDiff, 2) + POW(yDiff, 2) distance ← SQRT(sum) } The procedure relies on two provided functions, POW which returns a number raised to an exponent, and SQRT which returns the square root of a number. This procedure is missing a return statement, however. Part 1: Which line of code should the return statement be placed after? Part 2: Which of these return statements is the best for this procedure?

Part 1: After line 6 Part 2: RETURN distance

Ada notices that her classmate's program is very long and none of the code is grouped into procedures. How can Ada persuade her classmate to start organizing their code into procedures?

She can find places where her classmate's program has repeated code, and suggest using a procedure to wrap up that code.

Eloise wants to share her political views with family members living in another state but doesn't want her posts to be viewed by potential employers in the future. What is the best strategy for ensuring that?

She can send email messages with family members CC'ed on the email thread.

Online users are often asked to enter PII in online forms. In which of the following scenarios would it be least advisable to enter the requested PII?

Shi sees a posting for a product on a local marketplace, emails the poster, and is asked to reply back with her banking account information.

The administration of a high school decides to install antivirus software on all of the school computers. What can the antivirus software protect the computers from?

The antivirus software can protect the computers from any malware that it is able to successfully detect.

Mr. Jones bought a server where his students can upload homework assignments and mapped the domain "writing302.org" to it. He then acquired a digital certificate for "writing302.org" from a certificate authority and installed it on the server. What does the certificate prove?

The certificate proves that "writing302.org" and its associated encryption key are both owned by the same entity.

The code below processes two numerical values with a conditional statement. numA ← INPUT() numB ← INPUT() IF (numA > numB) { DISPLAY(numA) } ELSE { DISPLAY(numB) } The code relies on a built-in procedure, INPUT(), which prompts the user for a value and returns it. Which of the following best describes the result of running this code?

The code displays whichever number is greater, numA or numB, or displays numB if they are equal.

Ahmad is a graphic artist. He tweets a photo of his high school yearbook cover that he helped design. In what ways can the tweeted photo be used as PII?

The high school name indicates where Ahmad went to school.

A company develops a program to help high school counselors suggest career paths to students. The program uses a machine learning algorithm that is trained on data from social media sites, looking at a user's current job title, their background, and their interests. After counselors use the program for a while, they observe that the program suggests jobs in STEM (science, technology, engineering, math) much more often for male students than for other students. What is the most probable explanation for the bias in the career suggestions?

The machine learning algorithm was trained on data from a society where STEM jobs are more likely to be held by male-identified people due to historical bias.

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.

The goal of the MilkyWay@Home volunteer computing project is to build an accurate model of the Milky Way by simulating the composition of dark matter around the galaxy. Once volunteers sign up for the project and download the application, their computer will run models of the galaxy whenever it has spare CPU cycles. The results are sent back to the project's central database, so that scientists can identify the models with the best fit and publish the results. What's the primary benefit of enabling volunteers to run the models on their home computers?

The researchers do not have to pay for the computing power used by the home computers.

Lakeisha is developing a program to process data from smart sensors installed in factories. The thousands of sensors produce millions of data points each day. When she ran her program on her computer, it took 10 hours to complete. Which of these strategies are most likely to speed up her data processing?

Using parallel computing on a computer with a multi-core CPU.; Distributing the computing to multiple machines to run the program on subsets of the data.

A "red light camera" is a camera installed at street intersections that records whenever a car runs a red light. The camera records two images, one right before the car enters the intersection, and one after it's entered the intersection. In addition to the images, it records metadata about the incident: the date and time, the intersection location, the speed of the car, and the seconds elapsed past the light turning red. Which of these questions can be better answered by analyzing the metadata instead of the image data?

What is the average speed of a car when it runs a red light?; Which intersections have the greatest number of red light runners?

A digital artist is programming a natural simulation of waves. They plan to calculate the y position of the wave using this wave equation: The environment provides the built-in procedure cos(angle) which returns the cosine of angle. The built-in constant PI stores an approximation of PI. In the artist's code, the variable x represents the x position (), wL represents the wavelength (), and amprepresents the amplitude (). Which of these code snippets properly implements the wave formula?

amp * cos( ((2 * PI)/wL) * x)

This code snippet stores and updates a list that represents files in a folder: fileNames ← ["cow.mov", "dog.wav", "cat.jpg", "bird.avi", "fly.gif"] DISPLAY(fileNames[3]) INSERT(fileNames, 2, "goat.tif") INSERT(fileNames, 6, "spider.html") DISPLAY(fileNames[3]) What does this program output to the display?

cat.jpg; dog.wav

Fletcher is making an online ticket buying system for a museum. His program needs to calculate the final cost of a ticket with extra options added, a planetarium show and an IMAX 3D movie. The initial code looks like this: ticket ← 32 starShow ← 16 imax3D ← 9 Which code successfully calculates and stores the final cost?

finalCost ← ticket + starShow + imax3D; finalCost ← ticket + imax3D + starShow


संबंधित स्टडी सेट्स

Case Study 2 (Dyspnea and Shortness of Breath) - Prioritization, Delegation, and Assignment

View Set

Weekly Guide 4 and 5: Italian Renaissance, Mannerism

View Set

Mechanical Properties of Materials

View Set

Socioemotional Development in Late Adulthood, Death, Dying, and Grieving

View Set