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]
3 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]3 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
I need an answer and fast What happens if a sequence is out of order?
horsena [70]

Answer:

i would say A

hope i helped <3

Explanation:

4 0
3 years ago
Read 2 more answers
Why are typewriter keys arranged the way they are?
loris [4]
They are arranged the way they are because of the QWERTY layout. It was used to slow down how people typed so they wouldn't get the typewriter jammed. Hope this helps. :)
4 0
3 years ago
Computer crimes are a big concern since the creation of innovative technological advances; which is/are examples of computer cri
Natali [406]

Answer:

The answer is E: All of the above

Explanation:

All of the above scenarios are examples of serious computer crimes. They are crimes that exist in the offline world but take place online. Sexual predators, for instance, mostly take advantage of the anonymity provided by the internet. They often target dating sites and find suitable victims. Cyber bullying and Cyber stalking are just as harmful as any other computer crime. Industrial Espionage may also somehow fall into this category. Less frequently, criminals may steal documents and computer files or more often, illegally gain access to company’s trade secrets on computers and servers.

3 0
3 years ago
Read 2 more answers
Which of the following is a use for a honeynet? A. Detecting network attacks and scans B. Slowing down attackers C. Concealing n
inn [45]

Answer:

A. Detecting network attacks and scans

Explanation:

Honeynet

It is a network , which is set up with the intentional vulnerabilities , in order to invite the attack , in order to determine and study the activities of the attacker .

The Honeynet is composed of one or more honey pots , which are just the computer systems , which act as a bait to trap the people who , tries to hack or penetrate into other's computer system .

Hence ,

The correct option is Detecting network attacks and scans .

5 0
3 years ago
Long Answer Questions: a. Briefly explain the types of Control Structures in QBASIC.​
Alexus [3.1K]

Answer:

The three basic types of control structures are sequential, selection and iteration. They can be combined in any way to solve a specified problem. Sequential is the default control structure, statements are executed line by line in the order in which they appear.

7 0
3 years ago
Other questions:
  • When records are in ____ order, they are arranged one after another on the basis of the value in a particular field.?
    9·1 answer
  • Dylan, an interior designer, has sketched out a layout for a client's living room. He wants the client's approval of the layout
    11·2 answers
  • Create a new file that builds a shopping list from a user. There should be a input query that asks the user to list an item and
    11·1 answer
  • The presentation layer describes the layer where computers interact with _____
    8·2 answers
  • Most smartphones use operating systems developed by ________. Select one: A. Symbian and Apple B. Apple and Microsoft C. Microso
    13·1 answer
  • A type of graph that uses horizontal bars to compare data is called a
    15·2 answers
  • Enna always says thank you when people give her gifts. She even writes thank-you cards. On holidays, Enna remembers
    9·1 answer
  • When Creating a FPS game what basic rules would you add?
    12·1 answer
  • Complete the sentence
    6·2 answers
  • Pick one of the following scenarios and
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!