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, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
Ideally, the backrest is tilted back slightly, so when you turn the wheel your shoulders are the seat.
Answers: 2
question
Computers and Technology, 25.06.2019 01:00
What phrase indicates someone has knowledge and understanding of computer,internet,mobile devices and related technologies?
Answers: 1
You know the right answer?
Apcs question is very confusing. Given this code: public class LightSequence

{
Questions
question
English, 15.11.2020 14:00
question
History, 15.11.2020 14:00
question
Mathematics, 15.11.2020 14:00
question
Computers and Technology, 15.11.2020 14:00
question
Mathematics, 15.11.2020 14:00
question
Mathematics, 15.11.2020 14:00
Questions on the website: 13722360