当前位置: 首页 > wzjs >正文

中卫网站推广优化刷百度关键词排名

中卫网站推广优化,刷百度关键词排名,博客园 wordpress,今日山西省最新消息Author(wechat): bigshuang2020 ap csa tutor, providing 1-on-1 tutoring. 国际教育计算机老师, 擅长答疑讲解,带学生实践学习。 热爱创作,作品:ap csa原创双语教案,真题梳理汇总, AP CSA FRQ专题冲刺, AP CSA MCQ小题…

Author(wechat): bigshuang2020
ap csa tutor, providing 1-on-1 tutoring.
国际教育计算机老师, 擅长答疑讲解,带学生实践学习。
热爱创作,作品:ap csa原创双语教案,真题梳理汇总, AP CSA FRQ专题冲刺, AP CSA MCQ小题狂练。

2023 FRQ Q2 Sign

This question involves methods that distribute text across lines of an electronic sign. The electronic sign and the text to be displayed on it are represented by the Sign class. You will write the complete Sign class, which contains a constructor and two methods.

The Sign class constructor has two parameters. The first parameter is a String that contains the message to be displayed on the sign. The second parameter is an int that contains the w i d t h width width of each line of the sign. The width is the positive maximum number of characters that can be displayed on a single line of the sign.
A sign contains as many lines as are necessary to display the entire message. The message is split among the lines of the sign without regard to spaces or punctuation. Only the last line of the sign may contain fewer characters than the width indicated by the constructor parameter
The following are examples of a message displayed on signs of different widths. Assume that in each example, the sign is declared with the width specified in the first column of the table and with the message "Everything on sale,please come in", which contains 34 characters.

在这里插入图片描述

In addition to the constructor, the Sign class contains two methods.
The numberOfLines method returns an int representing the number of lines needed to display the text on the sign. In the previous examples, numberOfLines would return 3, 2, and 1, respectively for the sign widths shown in the table.

The getLines method returns a String containing the message broken into lines separated by semicolons (😉 or returns null if the message is the empty string. The constructor parameter that contains the message to be displayed will not include any semicolons. As an example, in the first row of the preceding table, getLines would return "Everything on s;ale, please com;e in".No semicolon should appear at the end of the String returned by getLines.

The following table contains a sample code execution sequence and the corresponding results. The code execution sequence appears in a class other than Sign.

StatementMethod Call Return Value (blank if none)Explanation
String str;
int x;
Sign sign1 = new Sign("ABC222DE", 3);The message for sign1 contains 8 characters, and the sign has lines of width 3.
x = sign1.numberOfLines();3The sign needs three lines to display the 8-character message on a sign with lines of width 3.
str = sign1.getLines();"ABC;222;DE"Semicolons separate the text displayed on the first, second, and third lines of the sign.
str = sign1.getLines();"ABC;222;DE"Successive calls to getLines return the same value.
Sign sign2 = new Sign("ABCD", 10);The message for sign2 contains 4 characters, and the sign has lines of width 10.
x = sign2.numberOfLines();1The sign needs one line to display the 4-character message on a sign with lines of width 10.
str = sign2.getLines();"ABCD"No semicolon appears, since the text to be displayed fits on the first line of the sign.
Sign sign3 = new Sign("ABCDEF", 6);The message for sign3 contains 6 characters, and the sign has lines of width 6.
x = sign3.numberOfLines();1The sign needs one line to display the 6-character message on a sign with lines of width 6.
str = sign3.getLines();"ABCDEF"No semicolon appears, since the text to be displayed fits on the first line of the sign.
Sign sign4 = new Sign("", 4);The message for sign4 is an empty string.
x = sign4.numberOfLines();0There is no text to display.
str = sign4.getLines();nullThere is no text to display.
Sign sign5 = new Sign("AB_CD_EF", 2);The message for sign5 contains 8 characters, and the sign has lines of width 2.
x = sign5.numberOfLines();4The sign needs four lines to display the 8-character message on a sign with lines of width 2.
str = sign5.getLines();"AB;_C;D_;EF"Semicolons separate the text displayed on the four lines of the sign.

Write the complete Sign class. Your implementation must meet all specifications and conform to theexamples shown in the preceding table.

2022 FRQ Q2 Book & Textbook

The Book class is used to store information about a book.
A partial Book class definition is shown.

public class Book {/** The title of the book */private String title;/** The price of the book */private double price;/** Creates a new Book with given title and price */public Book(String bookTitle, double bookPrice) {/* implementation not shown */}/** Returns the title of the book */public String getTitle() {return title;}/** Returns a string containing the title and price of the Book */public String getBookInfo() {return title + "-" + price;}// There may be instance variables, constructors, and methods that are not shown.
}

You will write a class Textbook, which is a subclass of Book.
A Textbook has an edition number, which is a positive integer used to identify different versions of the book.
The getBookInfo method, when called on a Textbook, returns a string that also includes the edition information, as shown in the example.

Information about the book title and price must be maintained in the Book class.
Information about the edition must be maintained in the Textbook class.

The Textbook class contains an additional method, canSubstituteFor, which returns true if a Textbook is a valid substitute for another Textbook and returns false otherwise.
The current Textbook is a valid substitute for the Textbook referenced by the parameter of the canSubstituteFor method if the two Textbook objects have the same title and if the edition of the current Textbook is greater than or equal to the edition of the parameter.

The following table contains a sample code execution sequence and the corresponding results.
The code execution sequence appears in a class other than Book or Textbook.

StatementValue Returned (blank if no value)Class Specification
Textbook bio2015 = new Textbook("Biology", 49.75, 2);bio2015 is a Textbook with a title of "Biology", a price of 49.75, and an edition of 2.
Textbook bio2019 = new Textbook("Biology", 39.75, 3);bio2019 is a Textbook with a title of "Biology", a price of 39.75, and an edition of 3.
bio2019.getEdition();3The edition is returned.
bio2019.getBookInfo();"Biology-39.75-3"The formatted string containing the title, price, and edition of bio2019 is returned.
bio2019.canSubstituteFor(bio2015);truebio2019 is a valid substitute for bio2015, since their titles are the same and the edition of bio2019 is greater than or equal to the edition of bio2015.
bio2015.canSubstituteFor(bio2019);falsebio2015 is not a valid substitute for bio2019, since the edition of bio2015 is less than the edition of bio2019.
Textbook math = new Textbook("Calculus", 45.25, 1);math is a Textbook with a title of "Calculus", a price of 45.25, and an edition of 1.
bio2015.canSubstituteFor(math);falsebio2015 is not a valid substitute for math, since the title of bio2015 is not the same as the title of math.

Write the complete Textbook class. Your implementation must meet all specifications and conform to the examples shown in the preceding table.

2021 FRQ Q2 SingleTable

  1. The class SingleTable represents a table at a restaurant.
public class SingleTable {/*** Returns the number of seats at this table. The value is always greater than or equal to 4.*/public int getNumSeats() { /*implementation not shown*/ }/*** Returns the height of this table in centimeters.*/public int getHeight() { /*implementation not shown*/ }/*** Returns the quality of the view from this table.*/public double getViewQuality() { /*implementation not shown*/ }/*** Sets the quality of the view from this table to value.*/public void setViewQuality(double value) { /*implementation not shown*/ }// There may be instance variables, constructors, and methods that are not shown.
}

At the restaurant, customers can sit at tables that are composed of two single tables pushed together. You will write a class CombinedTable to represent the result of combining two SingleTable objects, based on the following rules and the examples in the chart that follows.

  • A CombinedTable can seat a number of customers that is two fewer than the total number of seats in its two SingleTable objects (to account for seats lost when the tables are pushed together).
  • A CombinedTable has a desirability that depends on the views and heights of the two single tables. If the two single tables of a CombinedTable object are the same height, the desirability of the CombinedTable object is the average of the view qualities of the two single tables.
  • If the two single tables of a CombinedTable object are not the same height, the desirability of the CombinedTable object is 10 units less than the average of the view qualities of the two single tables.

Assume SingleTable objects t1, t2, and t3 have been created as follows.

  • SingleTable t1 has 4 seats, a view quality of 60.0, and a height of 74 centimeters.
  • SingleTable t2 has 8 seats, a view quality of 70.0, and a height of 74 centimeters.
  • SingleTable t3 has 12 seats, a view quality of 75.0, and a height of 76 centimeters.

The chart contains a sample code execution sequence and the corresponding results.

StatementValue Returned (blank if no value)Class Specification
CombinedTable c1 = new CombinedTable(t1, t2);A CombinedTable is composed of two SingleTable objects.
c1.canSeat(9);trueSince its two single tables have a total of 12 seats, c1 can seat 10 or fewer people.
c1.canSeat(11);falsec1 cannot seat 11 people.
c1.getDesirability();65.0Because c1’s two single tables are the same height, its desirability is the average of 60.0 and 70.0.
CombinedTable c2 = new CombinedTable(t2, t3);A CombinedTable is composed of two SingleTable objects.
c2.canSeat(18);trueSince its two single tables have a total of 20 seats, c2 can seat 18 or fewer people.
c2.getDesirability();62.5Because c2’s two single tables are not the same height, its desirability is 10 units less than the average of 70.0 and 75.0.
t2.setViewQuality(80);Changing the view quality of one of the tables that makes up c2 changes the desirability of c2, as illustrated in the next line of the chart. Since setViewQuality is a SingleTable method, you do not need to write it.
c2.getDesirability();67.5Because the view quality of t2 changed, the desirability of c2 has also changed.

The last line of the chart illustrates that when the characteristics of a SingleTable change, so do those of the CombinedTable that contains it.

Write the complete CombinedTable class. Your implementation must meet all specifications and conform to the examples shown in the preceding chart.

2020 FRQ Q2 GameSpinner

This question involves the creation and use of a spinner to generate random numbers in a game.
A GameSpinner object represents a spinner with a given number of sectors, all equal in size.
The GameSpinner class supports the following behaviors.

  • Creating a new spinner with a specified number of sectors
  • Spinning a spinner and reporting the result
  • Reporting the length of the c u r r e n t r u n current run currentrun, the number of consecutive spins that are the same as the most recent spin
    The following table contains a sample code execution sequence and the corresponding results.
StatementsValue Returned (blank if no value returned)Comment
GameSpinner g = new GameSpinner(4);Creates a new spinner with four sectors.
g.currentRun();0Returns the length of the current run. The length of the current run is initially 0 because no spins have occurred.
g.spin();3Returns a random integer between 1 and 4, inclusive. In this case, 3 is returned.
g.currentRun();1The length of the current run is 1 because there has been one spin of 3 so far.
g.spin();3Returns a random integer between 1 and 4, inclusive. In this case, 3 is returned.
g.currentRun();2The length of the current run is 2 because there have been two 3s in a row.
g.spin();4Returns a random integer between 1 and 4, inclusive. In this case, 4 is returned.
g.currentRun();1The length of the current run is 1 because the spin of 4 is different from the value of the spin in the previous run of two 3s.
g.spin();3Returns a random integer between 1 and 4, inclusive. In this case, 3 is returned.
g.currentRun();1The length of the current run is 1 because the spin of 3 is different from the value of the spin in the previous run of one 4.
g.spin();1Returns a random integer between 1 and 4, inclusive. In this case, 1 is returned.
g.spin();1Returns a random integer between 1 and 4, inclusive. In this case, 1 is returned.
g.spin();1Returns a random integer between 1 and 4, inclusive. In this case, 1 is returned.
g.currentRun();3The length of the current run is 3 because there have been three consecutive 1s since the previous run of one 3.

Write the complete GameSpinner class. Your implementation must meet all specifications and conform to the example.

2019 FRQ Q2 StepTracker

This question involves the implementation of a fitness tracking system that is represented by the StepTracker class. A StepTracker object is created with a parameter that defines the minimum number of steps that must be taken for a day to be considered active.

The StepTracker class provides a constructor and the following methods

  • addDailySteps, which accumulates information about steps, in readings taken once per day
  • activeDays, which returns the number of active days
  • averageSteps, which returns the average number of steps per day, calculated by dividing thetotal number of steps taken by the number of days tracked

The following table contains a sample code execution sequence and the corresponding results.

Statements and ExpressionsValue Returned (blank if no value)Comment
StepTracker tr = new StepTracker(10000);Days with at least 10,000 steps are considered active. Assume that the parameter is positive.
tr.activeDays();0No data have been recorded yet.
tr.averageSteps();0.0When no step data have been recorded, the averageSteps method returns 0.0.
tr.addDailySteps(9000);This is too few steps for the day to be considered active.
tr.addDailySteps(5000);This is too few steps for the day to be considered active.
tr.activeDays();0No day had at least 10,000 steps.
tr.averageSteps();7000.0The average number of steps per day is (14000 / 2).
tr.addDailySteps(13000);This represents an active day.
tr.activeDays();1Of the three days for which step data were entered, one day had at least 10,000 steps.
tr.averageSteps();9000.0The average number of steps per day is (27000 / 3).
tr.addDailySteps(23000);This represents an active day.
tr.addDailySteps(1111);This is too few steps for the day to be considered active.
tr.activeDays();2Of the five days for which step data were entered, two days had at least 10,000 steps.
tr.averageSteps();10222.2The average number of steps per day is (51111 / 5).

Write the complete StepTracker class, including the constructor and any required instance variables and methods. Your implementation must meet all specifications and conform to the example.

http://www.dtcms.com/wzjs/263945.html

相关文章:

  • 做俄语网站建设大一html网页制作作业
  • 集团网站建设定制网站建设百度大盘指数
  • 医院门户网站建设短视频推广平台有哪些
  • 制作小企业网站国内时事新闻
  • 做网站推广排名怎么在百度打广告
  • 宁波企业如何建网站无排名优化
  • 专注网站建设微信开发西安seo排名公司
  • 上海建设局网站深圳网站优化平台
  • 域名通过了才可以做网站吗赣州seo外包怎么收费
  • 河南网站备案系统短信长春网站优化团队
  • 大型网站建设建设公司seowhy教研室
  • 宁德蕉城城乡建设网站宁波seo推荐优化
  • 嘉兴网站建设推广免费百度下载
  • 寻找基础微网站开发站长工具 站长之家
  • 做二手手机交易网站公众号怎么推广
  • 网站设计网站建设公司旺道seo优化软件
  • 东莞网站制作有名 乐云践新百度搜索排名怎么收费
  • 个人商城网站建设关于市场营销的培训课程
  • 怎么做网站建设赚钱做app软件大概多少钱
  • 济南免费做网站交换友情链接的渠道
  • 设计头条官网企业关键词排名优化网址
  • 可信赖的做pc端网站怎么申请自己的域名
  • 怎么做网站的搜索引擎网站怎么优化推广
  • 网站开发研开发网站需要多少钱
  • 机械产品做哪个网站百度安全中心
  • 深圳公共资源交易网招标公告南通seo网站优化软件
  • 制作php网站网站seo公司
  • 成都制作网页整站seo外包
  • 天津网站建设工作室学习软件
  • 爱站网挖掘工具电脑优化软件排行榜