zuai-logo

Algorithms & Programming Fundamentals

Question 1
college-boardComputer Science PrinciplesAPExam Style
1 mark

If you have declared an integer variable named counter, which option correctly increases its value by one?

Question 2
college-boardComputer Science PrinciplesAPExam Style
1 mark

After increasing the size of variables in an algorithm from integer type holding values up to 32,767 (16 bits) to long integers holding much larger values (64 bits), what negative impact might occur during execution?

Question 3
college-boardComputer Science PrinciplesAPExam Style
1 mark

What is the output of the following code? grocery_list = ["milk", "eggs", "cheese"] i = 0 while i < len(grocery_list): print(grocery_list[i]) i += 1

Question 4
college-boardComputer Science PrinciplesAPExam Style
1 mark

What is the output of the following code? grocery_list = ["milk", "eggs", "cheese"] i = 0 while i < len(grocery_list): print(grocery_list[i]) i -= 1

Question 5
college-boardComputer Science PrinciplesAPExam Style
1 mark

Can you assign the value of one element to another? If no, why not?

Question 6
college-boardComputer Science PrinciplesAPExam Style
1 mark

What type of variable assignment strategy is critical when constructing a test suite aimed at capturing unexpected behaviors in a complex program’s algorithm?

Question 7
college-boardComputer Science PrinciplesAPExam Style
1 mark

Question #4: In which scenario would you use constants instead of variables within your program? Answers: CORRECT. The numeric value for pi needs to remain unchanged throughout execution. INCORRECT 1. A counter that increases every time a loop iterates is needed in the algorithm.. INCORRECT 2. A real-time tracker updat...

Feedback stars icon

How are we doing?

Give us your feedback and let us know how we can improve

Question 8
college-boardComputer Science PrinciplesAPExam Style
1 mark

What is the output of the following code? grocery_list = ["milk", "eggs", "cheese"] grocery_list.append("flour") print(grocery_list)

Question 9
college-boardComputer Science PrinciplesAPExam Style
1 mark

Given an integer array numbers with elements [4,8,15], what is the result after executing numbers[0] = numbers[1]; numbers[1] = numbers[2]; numbers[2] = numbers[0];?

Question 10
college-boardComputer Science PrinciplesAPExam Style
1 mark

What type of data practice involves using variables to store sensitive information like passwords temporarily in a program?