辅无忧老师能分享AP计算机科学考试真题吗?
随着留学大军的不断膨胀,越来越多学生选择读国际课程去海外留学,一些对计算机、工程、数学类专业感兴趣的学生,会在AP课程选择时关注计算机科学,近期有学生在寻找AP课程辅导,在我们官网询问:辅无忧老师能分享AP计算机科学考试真题吗?
自然是可以的,这里辅无忧给大家简单分享部分2019年的AP计算机科学考试真题,供学生们参考:
Section I: Multiple Choice
1.Which of the following Java statements is equivalent to
!(x > 0 || x < 10)
A. !x > 0 && !x < 10
B. !(x > 0) || !(x < 10)
C. !(x > 0) && !(x < 10)
D. !x > 0 || !x < 10
E. None of the above
2.Which of the following method headings correctly defines a method that accepts an integer array as a parameter and returns the sum of the elements in the array?
A. public int sum(int[] nums)
B. public int[] sum(int[] nums)
C. public void sum(int[] nums)
D. public int[] sum(int nums[])
E. public int sum(int nums[])
3.What is the output of the following code segment?
int[][] arr = {{2, 4}, {6, 8}};
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
System.out.print(arr[i][j] + " ");
}
}
A. 2 4 6 8
B. 2 6 4 8
C. 4 2 8 6
D. 4 8 2 6
E. 6 2 8 4
4.Consider the following class hierarchy:
public class Animal {}
public class Mammal extends Animal {}
public class Reptile extends Animal {}
public class Dog extends Mammal {}
public class Cat extends Mammal {}
public class Snake extends Reptile {}
Which of the following statements is NOT true?
A. Dog is a Mammal.
B. Snake is an Animal.
C. Cat is a Reptile.
D. Reptile is an Animal.
E. None of the above.
5.What is the output of the following code segment?
String str1 = "apcs";
String str2 = "apcs";
String str3 = new String("apcs");
System.out.print(str1 == str2);
System.out.print(str1 == str3);
System.out.print(str1.equals(str2));
System.out.print(str1.equals(str3));
A. truefalsefalsefalse
B. truetruetruefalse
C. truefalsetruefalse
D. falsetruefalsetrue
E. falsefalsetruefalse
Section II: Free Response
1.Write the code for a recursive method that takes a non-negative integer n as a parameter and returns the nth Fibonacci number, where the first two Fibonacci numbers are 0 and 1.
2.A class named ComboLock has a three-digit combination lock. The lock is opened by turning the dial to the right, then to the left, and then to the right again. When the lock is turned to the right, the dial must be turned clockwise to the first digit in the combination. When the lock is turned to the left, the dial must be turned counter-clockwise to the second digit in the combination. Finally, when the lock is turned to the right again, the dial must be turned clockwise to the third digit in the combination. The ComboLock class should have the following methods:
public ComboLock(int secret1, int secret2, int secret3) - Constructor that initializes the combination to the values of the three parameters.
public void reset() - Resets the dial so that it points to 0.
public void turnRight(int ticks) - Turns the dial clockwise the specified number of ticks. A tick is a unit of the combination lock, and the dial has 40 ticks labeled 0 through 39.
public void turnLeft(int ticks) - Turns the dial counter-clockwise the specified number of ticks.
public boolean open() - Returns true if the lock can be opened (the dial is pointing to the correct combination), false otherwise.
Write the complete ComboLock class. You may assume that all parameters passed to the methods are valid (i.e., non-negative integers). Note that you only need to implement the methods listed above, not the entire class.
辅无忧老师能分享AP计算机科学考试真题吗?上面已经给大家分享了部分真题内容,应对任何考试,学生想要高分通过,都需要不断练习真题,当然也可以寻找国际课程辅导的帮助,如果你正好有AP计算机科学辅导等需求,可以随时向辅无忧寻求辅导帮助。
- 香港浸会大学MKT7080考试辅导补习 2024-12-13
- 香港浸会大学FIN7940课程考试辅导哪... 2024-12-13
- 香港浸会大学CHEM2015考试辅导找哪... 2024-12-13
- 香港浸会大学AIDM7010考试辅导推荐 2024-12-13
- 香港大学FINA2390考试辅导找哪家 2024-12-13
- 香港大学PHYS8852考试辅导选哪个机... 2024-12-13
- 南洋理工大学电子电气工程作业考试辅导... 2024-12-13
- 滑铁卢大学STAT374考试辅导怎么收费 2024-12-13
- 滑铁卢大学stat337课程考试辅导哪家好 2024-12-13
- 澳门科技大学财务管理课程考试辅导选哪... 2024-12-13