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
sertanlavr [38]
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. 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.
Computers and Technology
1 answer:
Bas_tet [7]3 years ago
5 0

Answer:

int firstNumber, secondNumber, duplicates;

secondNumber = duplicates = 0;

firstNumber = stdin.nextInt();

while (stdin.hasNextInt() && firstNumber > -1 && secondNumber > -1)

{

   secondNumber = stdin.nextInt();

   if (firstNumber == secondNumber)

   {

       duplicates++;

   }

   firstNumber = secondNumber;

}

System.out.println(duplicates);

Explanation:

The code is in JAVA.

You might be interested in
What is a life cycle
pochemuha

the definition of a life cycle is  the series of changes in the life of an organism, including reproduction

let me know if I helped <em>@OfficalOliviaB.</em>

4 0
3 years ago
Read 2 more answers
What ethical concerns might arise from applying new IT to law enforcement?
pentagon [3]

Answer:

One ethical concern that might occur is the rise of bias in the police department. It would be possible for a disgruntled or frustrated cop to lean into new IT and be able to take advantage of a past suspect or an "enemy" of theirs such as a neighbor or even a coworker.

6 0
3 years ago
Application software can run without the presence of system software true or false ​
sesenic [268]

Answer:

false

...........

.....

8 0
3 years ago
A car holds 16 gallons of gasoline and can travel 312 miles before refueling. Write aC++ program that calculates the number of m
IgorC [24]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables Declaration and initialization

   int no_gallon=16;

   int dis=312;

   // find the miles per gallon

   double mile_gallon=dis/double(no_gallon);

   // print the results

   cout<<"number of gallons: "<<no_gallon<<endl;

   cout<<"distance travel before refueling: "<<dis<<endl;

   cout<<"miles per gallon is: "<<mile_gallon<<endl;

return 0;

}

Explanation:

Declare and initialize the number of gallon and distance travel without refueling. Calculate the miles per gallon by dividing distance with number of gallons.Then print the results.

Output:

number of gallons: 16

distance travel before refueling: 312

miles per gallon is: 19.5

6 0
3 years ago
A term to describe articles that can be displayed in their entirety,as opposed to abstract and references only
babunello [35]

Answer:

Full Record - A screen containing complete or detailed citation information which may include a summary or abstract. Full Text - A term to describe articles that can be displayed in their entirety, as opposed to Abstract and References only.

Explanation:

5 0
3 years ago
Other questions:
  • Wendy is an attacker who recently gained access to a vulnerable web server running Microsoft Windows. What command can she use t
    9·1 answer
  • With respect to the general classes of computers, a ________ is the most expensive and most powerful kind of computer, which is
    7·1 answer
  • PLEASE HELP
    14·2 answers
  • George, a user, has contacted you to complain that his issue has not been resolved. He has already contacted your department twi
    9·1 answer
  • A style manual can be described as
    11·2 answers
  • Escribe, en los siguientes cuadros, los conceptos que correspondan
    10·1 answer
  • In a swap you need a variable so that one of the values is not lost ? Need help
    7·2 answers
  • Which of the following statements holds true for the term plug-in? Group of answer choices It refers to a program (typically a m
    11·1 answer
  • Only cool people answer this question.<br><br><br><br><br> are you cool?
    11·2 answers
  • To verify a Windows system meets the minimum processor and memory requirements to install software, use the ________.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!