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
Jason is the network manager and is leading a project to deploy a SAN. He is working with the vendor's support technician to pro
ikadub [295]

Answer:

Network diagrams.

Explanation:

In this scenario, Jason is the network manager and is leading a project to deploy a storage area network (SAN). He is working with the vendor's support technician to properly set up and configure the SAN on the network. To begin SAN input and output (I/O) optimization, Jason need to provide the network diagram to the vendor support technician.

A network diagram can be defined as a graphical representation of the topology of a network connection.

Basically, it gives an illustration of all the equipments such as routers, switches, hubs etc.

7 0
2 years ago
Sean has trouble remembering all the geometry formulas. What can he do to make sure he doesn't forget these formulas during his
son4ous [18]
3 i think but im not sure
7 0
2 years ago
Read 2 more answers
How does Python recognize a tuple?
Talja [164]

Answer:

B) You use parentheses around the data values

Explanation:

It was C) on my end, but the answer is still the same :)

7 0
3 years ago
Read 2 more answers
Explain the levels of data model​
gregori [183]

Answer:

Data modeling occurs at three levels—physical, logical, and conceptual.

  • A physical model is a schema or framework for how data is physically stored in a database.

  • A conceptual model identifies the high-level, user view of data.

  • A logical data model sits between the physical and conceptual levels and allows for the logical representation of data to be separate from its physical storage.

4 0
3 years ago
When was JavaScript founded?<br> Write in this format:<br> mm/yy
liq [111]

Answer:

It was founded in 09/95

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • The Olympic Games that people celebrate today are much different from the Olympics that began in ancient Greece. When the Olympi
    13·2 answers
  • Select all that apply.
    8·2 answers
  • Describe shortly about the following Linux directories and theirpurpose,1. lib2. etc3. Boot4. Root5. home
    6·1 answer
  • Modify the program so the output is: Annual pay is 40000 Note: Whitespace (blank spaces / blank lines) matters; make sure your w
    9·1 answer
  • How many bytes make up a megabyte? One hundred One thousand One million One billion
    12·1 answer
  • Using C#, declare two variables of type string and assign them a value "The "use" of quotations causes difficulties." (without t
    11·1 answer
  • HELP 25 POINTS!!!!!
    6·2 answers
  • Is the Internet dangerous?
    10·2 answers
  • Will give brainliest!!!!!!!!
    15·2 answers
  • Yeah help me please......................
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!