1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Anettt [7]
3 years ago
6

Consider the following class. 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 */ } } Question 1 (a) Write a statement to create a LightSequence object gradShow that has the initial light sequence "0101 0101 0101". Write the statement below. Question 2 (b) Write a statement that will call the display method to display the light sequence for the gradShow object. Write the statement below. Question 3 (c) Write a statement that will be used to update the gradShow light sequence to "0011 0011 0011". Write the statement below. Question 4 (d) Write a code segment that will call the insertSegment method to insert the segment "1111 1111" in the current sequence for gradShow at index 4. The resulting sequence will be stored in the string resultSeq. Write the code segment below. Question 5 (e) Assume that the string oldSeq has been properly declared and initialized. Write a code segment that will remove the first occurrence of the string segment from oldSeq and store it 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. If oldSeq is "11111" and segment is "00", then "11111" should be stored in newSeq. Write the code segment below. Your code segment should meet all specifications and conform to the examples. Question 6 (f) Two lights will be arranged on a two-dimensional plane. The vertical distance between the two lights is stored in the double variable a. The horizontal distance between the two lights is stored in the double variable b. The straight-line distance between the two lights is given by the formula a2+b2−−−−−−√. Write a code segment that prints the straight-line distance between the two lights according to the formula above.
Computers and Technology
2 answers:
Ugo [173]3 years ago
4 0
WHAT IS THISSSSSSSSSSSSSSSSSS
jok3333 [9.3K]3 years ago
4 0
Umm no idea lollllll
You might be interested in
Which of the following statements represents a scientific bias?
valina [46]

Answer: Use data from the previous steps because they show better results

Explanation:

A scientific bias occurs when there's a deviation between the observations of a researcher and the accurate representation of data and results.

In this case, the use of data from the previous steps because they show better results will bring about a data bias as it'll lead to inaccuracies of the data being represented.

5 0
3 years ago
Robot is an example of which generation computer?​
n200080 [17]

Robot is an example of Fifth Generation Computer.

I hope it's help you...

Thanks♥♥

6 0
3 years ago
What is a leased line​
scoundrel [369]

Explanation:

A leased line is a dedicated fixed bandwidth data connection. The word leased refers to the connection rented by the internet service provider directly to a business. A leased line needs to be symmetrical, uncontended and point to point

3 0
3 years ago
Read 2 more answers
Suppose list is a one dimensional array of size 25, where in each component is of type int. Further, suppose that sum is an int
Varvara68 [4.7K]

Answer:

# include <conio.h>

# include <iostream.h>

using namespace std;

main{

int a[25], sum;

cout<<"enter the values in array a";

for (int i=0; i<= 24 ; i++)

{

cin>>a[i];

}

sum =0;

for (int j=0;  j<=24 ; j++)

{

sum= sum + a[j];

}

cout<< sum;

getch ();

}

5 0
3 years ago
Read 2 more answers
A standardized specification of a motherboard (including its dimensions, supported power supply types, and layout of components)
Alik [6]
The correct answer is 'Form Factor'. The standardized specification of a motherboard ( including it's dimensions, supported power supply types, and layout of components) is know as the motherboard's form factor.
5 0
3 years ago
Other questions:
  • In the ____, or ad hoc, layouts configuration, there is no access point at the center of a cell.
    7·1 answer
  • In a(n) ________ either one condition or some other condition must be met in order for an event to take place.
    11·1 answer
  • The file manager used in Microsoft Windows is
    11·1 answer
  • What are some ways to change column width? Check all that apply.
    13·2 answers
  • What is transmission control protocol?
    9·2 answers
  • Jackson is teaching a class the concept of the binary number system. Which term will he use to refer to the leftmost bit of a bi
    11·2 answers
  • Which function of NOS involves swapping programs and files
    6·1 answer
  • What is the primary way to access applications in window 10
    7·1 answer
  • Use______ to format cells when they meet a certain criteria.
    13·1 answer
  • ....................
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!