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
zavuch27 [327]
3 years ago
6

Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is consi

dered a consecutive duplicate. In this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. Note that the last 3 is not a consecutive duplicate because it was preceded by a 7. Write some code that uses a loop to read such a sequence of non-negative integers , terminated by a negative number. When the code finishes executing, the number of consecutive duplicates encountered is printed. In this case, 3 would be printed. Assume the availability of a variable, stdin, that references a Scanner object associated with standard input. That is, stdin = new Scanner(System.in); is given.
Computers and Technology
1 answer:
Darya [45]3 years ago
3 0

// Variable to keep track of array size

int length = 0;

// Array itself

int array[] = {};

// while loop will take input in the array until a negative number is entered

while(input>=0){

stdin = new Scanner(System.in);

array[length] = stdin;

length +=1;

}

// int variable to terminate while loop

int i =0;

// keep track of index of output array

int y =0;

while(arr[i] != length){

// making output array

int output[]={}; bool flag;

// put the element in out put array considering if it the desired one

output[y] = array [i];

// Now check if it was the desired?

for(int z=1;z<=length;z++){

if(array[i+z]!=output[y]){

 flag = true;

}

else

{

 output[y]=0;

 y+=1;

}

if(array[i+z+1]=output[y] && flag == true){

output[y] = array[i];

y+=1;

}

}

//output the array

for(int o=0;o<y;o++)

System.out.println(output[o];

You might be interested in
An operating system coordinations the___ of a computers operation
qwelly [4]
\\\\\\\\\\\\\\\\\\\\\\\\\Operating system///////////////////////
                            Is the Answer
8 0
3 years ago
The capacity of a communication channel is measured in _______.
PSYCHO15rus [73]
<span>The capacity of a communication channel is measured in gb and gps.</span>
4 0
3 years ago
Read 2 more answers
Javascript and java are really just two slightly different names for the same language.
Lunna [17]

Answer:

False

Explanation:

JavaScript is language used along with html documents.

Java is a full-fledged programming language that handles applications.

7 0
2 years ago
BITS wants to store information about the supervisors, including their supervisor number and the relationship to consultants. Su
Olin [163]

Answer:

Convert the table into normalize form

Explanation:

Un normalized relation of the given schedule is as

Consultant ( ConsultNum, Last Name, First Name, Street, City, ZipCode

HoursRate (SupervisorNum, Supervisor Num)

(Tasks, Description, Catagory, Price, SupervisorNum))

According to these functional dependencies :

SupervisorNum is dependencies of the SupervisiorNum

ConsltNum is dependencies of the Last Name, First Name, Street, City, ZipCode, Hours, Rate

Tasks are dependencies of Description, Category, Price

The consultant table is not in a normalized form as it contains repeating groups. Make composite keys such as Supervisor Num, Tasks and ConsltNum and convert the table in NF by removing repeating groups

Such as table in NF

Consultant

(Consult Num, Last Name, First Name, Street, City, Zip Code, Hours, Rate

Supervisor Num, Supervisor Name, Tasks, Description, Category, Price)              

5 0
3 years ago
If you're under 18 and you receive _____ or more license points in 12 months, you'll be restricted to driving only to school or
IRISSAK [1]

Answer:

B:6

Explanation:

FLVS :)

6 0
3 years ago
Other questions:
  • . What is automated testing?
    10·1 answer
  • Imagine that you have a friend who has expressed interest in designing and programming video games. He loves to play video games
    10·1 answer
  • What are the two categories of problems that we can simply convert<br> to parallel code?
    10·1 answer
  • Have fire have ....<br><br>babi​ from babi098
    7·1 answer
  • Write: In a five-paragraph essay that is two to three pages in length, address the
    13·1 answer
  • What is pseudo code?
    11·2 answers
  • 3. Create mode was one of the most innovative and influential features of which of the following games?
    7·1 answer
  • What is Data rate?<br> What is BAUD RATE?<br> What is bandwidth?
    8·1 answer
  • Drag each tile to the correct box.
    9·2 answers
  • In a typical office, biometric authentication might be used to control access to employees and registered visitors only. We know
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!