subject

Apcs question is very confusing. Given this code: public class LightSequence

{

// attributes not shown

/** The parameter seq is the initial sequence used for

* the light display

*/

public LightSequence(String seq)

{ /* implementation not shown */ }

/** Inserts the string segment in the current sequence,

* starting at the index ind. Returns the new sequence.

*/

public String insertSegment(String segment, int ind)

{ /* implementation not shown */ }

/** Updates the sequence to the value in seq

*/

public void changeSequence(String seq)

{ /* implementation not shown */ }

/** Uses the current sequence to turn the light on and off

* for the show

*/

public void display()

{ /* implementation not shown */ }

}

the question is
Assume that the string oldSeq has been properly declared and initialized and contains the string segment. Write a code segment that will remove the first occurrence of segment from oldSeq and store it in the string newSeq. Consider the following examples.

If oldSeq is "1100000111" and segment is "11", then "00000111" should be stored in newSeq.
If oldSeq is "0000011" and segment is "11", then "00000" should be stored in newSeq.
If oldSeq is "1100000111" and segment is "00", then "11000111" should be stored in newSeq.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select โ€œstateโ€ under field name, then type in the state name under โ€œequal toโ€
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Write an essay on online collaboration, how to do it, the challenges, resolving the challenges, and consider whether the risks are greater than rewards. ( need )
Answers: 1
You know the right answer?
Apcs question is very confusing. Given this code: public class LightSequence

{
Questions
question
Mathematics, 04.05.2021 02:40
question
Mathematics, 04.05.2021 02:40
question
Mathematics, 04.05.2021 02:40
question
English, 04.05.2021 02:40
question
Mathematics, 04.05.2021 02:40
question
Mathematics, 04.05.2021 02:40
Questions on the website: 13722361