AP Computer Science Principles Pre-Test

AP Computer Science Principles Pre-Test

10th Grade

30 Qs

quiz-placeholder

Similar activities

Quiz Microsoft Excel

Quiz Microsoft Excel

10th Grade - University

30 Qs

Using the Developer Tab in Word

Using the Developer Tab in Word

10th Grade - University

25 Qs

Computer Architecture Quiz

Computer Architecture Quiz

10th Grade

30 Qs

EVALUASI TENGAH SEMESTER GENAP

EVALUASI TENGAH SEMESTER GENAP

10th Grade - University

30 Qs

Code.org lesson 3 and 4 quiz

Code.org lesson 3 and 4 quiz

7th Grade - University

25 Qs

7.2.1 Branching Statements Quizizz Extra Practice

7.2.1 Branching Statements Quizizz Extra Practice

10th Grade

29 Qs

TEST BANK: NETWORKS AND DIGITAL SECURITY

TEST BANK: NETWORKS AND DIGITAL SECURITY

9th - 12th Grade

35 Qs

AP Computer Science Principles Pre-Test

AP Computer Science Principles Pre-Test

Assessment

Quiz

Information Technology (IT)

10th Grade

Medium

Created by

Ethan Batres

Used 4+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to declare a variable in JavaScript?

`var myVariable;`

`variable myVariable;`

`declare myVariable;`

`int myVariable;`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

var x = 5;

var y = 10;

console.log(x + y);

15

510

5

10

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a function declaration in JavaScript?

`function myFunction() {}`

`let myFunction = function() {}`

`const myFunction = () => {}`

`myFunction() = function() {}`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the scope of a variable declared with `var` inside a function?

Global

Local to the function

Local to the block

Local to the script

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code:

function add(a, b) {

return a + b;

}

What will `add(3, 4)` return?

34

7

12

undefined

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to create a list (array) in JavaScript?

`var myList = {};`

`var myList = [];`

`let myList = ();`

`let myList = <>;`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

var fruits = ['apple', 'banana', 'cherry'];

console.log(fruits[1]);

apple

banana

cherry

undefined

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?