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
Alinara [238K]
4 years ago
7

python 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 i

s considered 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.
Computers and Technology
1 answer:
Vika [28.1K]4 years ago
7 0

int firstNumber,secondNumber = -1, duplicates = 0;

do {

cin >> firstNumber;

if ( secondNumber == -1) {

secondNumber = firstNumber;

}else {

if ( secondNumber == firstNumber )

duplicates++;

else

secondNumber = firstNumber;

}

} while(firstNumber > 0 );

cout << duplicates;

You might be interested in
Configuring a firewall to ignore all incoming packets that request access to a specific port is known as ____.
Sati [7]

Answer: Logical Point Blocking

Explanation:

4 0
1 year ago
Thsi is for gacha girl5467
djyliett [7]

Answer:

lol

Explanation:

3 0
3 years ago
Read 2 more answers
Connection-oriented protocols protect against dropped data by forming connections and using what type of constant stream?
nataly862011 [7]

Answer:

A real constany

Explanation:

5 0
3 years ago
What is the Difference between CUI and GUI
Fynjy0 [20]

Hi there!


GUI Means Graphical user interface


CUI means  Controlled Unclassified Information


Theres the difference they are completely different from each other.


PLEASE MARK BRAINLIEST

-WeasuLL

7 0
3 years ago
Read 2 more answers
A company wants to publish Knowledge articles to its Customer Community. The articles should be organized for easy navigation by
olchik [2.2K]

Answer:

Define Topics for each Knowledge article

Explanation:

Knowledge article has been written about the services or products that a company offers. It is the information related to some particular product or service. The information contain the knowledge about products, ingredients, how to use the product etc.

To provide this information to the community members, a consultant recommend that, define topic for each knowledge article. So that, a particular person can find this information by searching through topic name.

5 0
3 years ago
Other questions:
  • Which computer network component allows data transfers from one computer to another through a telephone line?
    11·2 answers
  • What was the first fully computer animated feature film?
    13·1 answer
  • In C++ Please :
    6·1 answer
  • ________ allows the computer to get its configuration information from the network instead of the network administrator providin
    5·1 answer
  • What is the binary system?
    13·2 answers
  • Which method is an easy way to find a short description of a function?
    5·2 answers
  • GIVING BRAINLIEST Jenna creates advertisements for companies to air on television. Which file format will best preserve the grap
    5·2 answers
  • How does it transform your ways of socializing
    11·1 answer
  • Help its in binary and im a small brain for that
    7·1 answer
  • Give an example of how loops are used in programming Kturtle​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!