• 咨询电话 13023111482
  • 犀牛首页
  • IB课程
  • AP课程
  • G5笔面试
  • AMC竞赛
  • HMMT竞赛
  • 物理碗竞赛
犀牛教育
  • AP力学真题
  • AP物理1真题
  • AP物理2真题
  • AP计算机真题
  • AP生物真题
  • AP化学真题
  • AP电磁学真题

AP计算机真题

首页 > AP > AP计算机 > AP计算机真题

2017年AP计算机简答题真题PDF下载

2021-08-10

2017年AP计算机简答题真题PDF下载

1. This question involves identifying and processing the digits of a non-negative integer. The declaration of the Digits class is shown below. You will write the constructor and one method for the Digits class.

public class Digits

{

/** The list of digits from the number used to construct this object.

* The digits appear in the list in the same order in which they appear in the original number.

*/

private ArrayList digitList;

/** Constructs a Digits object that represents num.

* Precondition: num >= 0

*/

public Digits(int num)

{ /* to be implemented in part (a) */ }

/** Returns true if the digits in this Digits object are in strictly increasing order;

* false otherwise.

*/

public boolean isStrictlyIncreasing() { /* to be implemented in part (b) */ }

}

(a) Write the constructor for the Digits class. The constructor initializes and fills digitList with the digits from the non-negative integer num. The elements in digitList must be Integer objects representing single digits, and appear in the same order as the digits in num. Each of the following examples shows the declaration of a Digits object and the contents of digitList as initialized by the constructor.

Complete the Digits constructor below.

/** Constructs a Digits object that represents num.

* Precondition: num >= 0

*/

public Digits(int num)

(b) Write the Digits method isStrictlyIncreasing. The method returns true if the elements of digitList appear in strictly increasing order; otherwise, it returns false. A list is considered strictly increasing if each element after the first is greater than (but not equal to) the preceding element. The following table shows the results of several calls to isStrictlyIncreasing.

Complete method isStrictlyIncreasing below.

/** Returns true if the digits in this Digits object are in strictly increasing order;

* false otherwise.

*/

public boolean isStrictlyIncreasing()

2017年AP计算机简答题真题余下省略!


你可能还关注

  1. 2021年AP计算机简答题真题PDF下载 2021-08-10   
    2021年AP计算机简答题真题PDF下载
    详情阅读
  2. 2019年AP计算机简答题真题PDF下载 2021-08-10   
    2019年AP计算机简答题真题PDF下载
    详情阅读
  3. 2018年AP计算机简答题真题PDF下载 2021-08-10   
    2018年AP计算机简答题真题PDF下载
    详情阅读
  4. 2016年AP计算机简答题真题PDF下载 2021-08-10   
    2016年AP计算机简答题真题PDF下载
    详情阅读
  5. 2015年AP计算机简答题真题PDF下载 2021-08-10   
    2015年AP计算机简答题真题PDF下载
    详情阅读

扫码免费下载真题

AP计算机真题

  • 2021年AP计算机简答题真题PDF下载
  • 2019年AP计算机简答题真题PDF下载
  • 2018年AP计算机简答题真题PDF下载
  • 2017年AP计算机简答题真题PDF下载
  • 2016年AP计算机简答题真题PDF下载
  • 2015年AP计算机简答题真题PDF下载
犀牛国际

犀牛国际(X-NEW),由业内多名教学专家共同组建,不乏来自加州理工大学、剑桥大学、清华大学、北京大学、复旦大学、新加坡国立大学等国际一流大学。 其中有博士、硕士的学历老师众多,学术功底扎实,有的已经执教十余年,国际领域经验丰富。

国际学科

  • IB课程辅导
  • AP课程培训
  • A-Level课程培训
  • IGCSE课程辅导

国际竞赛

  • AMC数学竞赛
  • AIME数学竞赛
  • HiMCM竞赛
  • PUMaC竞赛
  • HMMT竞赛
  • 滑铁卢数学竞赛
  • 物理碗竞赛
  • BPhO竞赛
  • BAAO竞赛
  • USNCO竞赛
  • UKCHO竞赛
  • CCC竞赛
  • USABO竞赛
  • BBO竞赛
  • BRAIN BEE

G5笔面试

  • STEP
  • PAT
  • ECAA
  • LNAT
  • MAT
  • TSA
  • NSAA
  • BMAT
  • ENGAA
  • CTMUA
犀牛国际 版权所有 沪ICP备2021004381号-1