Search Header Logo
APCSP Unit 5 Review

APCSP Unit 5 Review

Assessment

Presentation

Computers

10th Grade

Practice Problem

Hard

Created by

Rebecca Roemer

Used 13+ times

FREE Resource

6 Slides • 0 Questions

1

media

​After running the code below, what values will the cities list print in the console.log?

2

media

​Assume that your cities.length is 6 and your index begins at 0 and that cityLabel is design element on the screen. How does this piece of code work and what would be a hypothetical result of the program running?

3

media

​How many times does this loop run? What does i++ do? Assume that each city label takes the form of city0, city1, city2, city3, city 4 and city5. Explain how the SetProperty block can create color inputs for each city design element.

4

In App Lab, create this program. What prints?

var word="supercalifragilisticexpialidocious"; console.log(word.substring(0, word.length)); console.log(word.substring(1, word.length-1)); console.log(word.substring(2,3)); console.log(word.substring(3,2));

5

In App Lab, See if the first letter is the same as the last letter in a word.

var word="racecar";

var first=word.substring(0,1);

var last=word.substring(word.length-1,word.length);

console.log(first == last);

6

In App Lab - just for fun.

Generate the first 10 numbers in the fibonacci sequence.

var fibonacci=[1,1];

var nextTerm=0; for (var i=3; i<=10; i++) { nextTerm=fibonacci[i-2]+fibonacci[i-3]; insertItem(fibonacci, i, nextTerm); } console.log(fibonacci);

media

​After running the code below, what values will the cities list print in the console.log?

Show answer

Auto Play

Slide 1 / 6

SLIDE