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
What are source data entry devices​
matrenka [14]

Answer:

<u><em>Source data entry devices are used for audio input, video input and to enter the source document directly to the computer. Source data entry devices do not require data to be typed-in, keyed-in or pointed to a particular location.</em></u>

Explanation:

7 0
2 years ago
GenXTech is a growing company that develops gaming applications for military simulations and commercial clients. As part of its
ki77a [65]

Answer:

an enterprise architecture

Explanation:

Based on the information provided within the question it can be said that in this scenario it seems that GenXTech is creating an enterprise architecture. This is a blueprint made for a company that illustrates and defines all the finer details regarding the structure and operation of an organization, as well as where the organization should be heading in order to achieve the business goals that have already been set.

6 0
2 years ago
Write c program to check character is alphabate or not?​
Elan Coil [88]

Lookup the isalpha() function in the C standard library, this function will check and return non-zero for alphabetic characters.

8 0
3 years ago
What is the name of the finned metal device that radiates heat away from the processor?
dezoksy [38]
This is called a "heat sink", essentially, a metal plate makes indirect <span>(its separated by thermal paste)</span> contact with the heat spreader of a cpu (central processing unit). The concept is that the heat sink is made of highly conductive materials thus conducting heat away from the CPU, quite often you'll find a fan attached to further disparate heat away from the heat-sink. These days you'll alternative cooling methods, the most common alternative is to use watercooling (another topic). GPU (graphic processing units) also have heatsinks.    
3 0
3 years ago
A computer has a pipeline with four stages. each stage takes the same time to do its work, namely, 1 nsec. how many instructions
prisoha [69]

In figuring, a pipeline, otherwise called an information pipeline, is a lot of information preparing components associated in arrangement

Further explanation:

In figuring, a pipeline, otherwise called an information pipeline, is a lot of information preparing components associated in arrangement, where the yield of one component is the contribution of the following one. The components of a pipeline are frequently executed in parallel or in time-cut style.

Instruction travelling:

999,999,997 guidelines for each second. The pipeline has 3 nsec of straightforward figurings, at that point finishes a guidance in each ensuing nsec.  

3nsec (for first guidance to go down the pipeline).10^9 ns every second. 10^9 – 3 = 999999997 directions.

Instruction per second:

MIPS - Million guidelines for each second  

Million guidelines for each second (MIPS) is a more established, outdated proportion of a PC's speed and power, MIPS measures generally the quantity of machine directions that a PC can execute in one second.

Per second:

Million directions for each second (MIPS) is a more established, old proportion of a PC's speed and power, MIPS measures generally the quantity of machine guidelines that a PC can execute in one second. Be that as it may, various directions require pretty much time than others, and there is no standard strategy for estimating MIPS. Moreover, MIPS alludes just to the CPU speed, while genuine applications are commonly constrained by different elements, for example, I/O speed

Answer Details:

Subject: Computer and technology

Level: College.

Key Words:

Further explanation:

Per second:

Instruction per second:

Instruction travelling:

For further Evaluation:

brainly.com/question/6362387

brainly.com/question/12938965

6 0
3 years ago
Read 2 more answers
Other questions:
  • Reflexes are basically "hard-wired" into the CNS. Anatomically, the basis of a reflex is an afferent neuron that synapses direct
    10·1 answer
  • . Hackers generally disguise their IP address. True False
    9·1 answer
  • When should an individual consider entering parenthood?
    5·1 answer
  • Suppose your name was Alan Turing. Write a statement that would print your last name, followed by a comma, followed by a space a
    10·1 answer
  • Wireless attacks avoid the access points to limit detection. <br> a. True <br> b. False
    9·1 answer
  • Write an application that determines the value of the coins in a jar and prints the total in dollars and cents. Read integer val
    6·2 answers
  • A stateless firewall inspects each incoming packet to determine whether it belongs to a currently active connection.
    9·1 answer
  • Why are object-oriented languages very popular?
    11·2 answers
  • The students of a college have to create their assignment reports using a word processing program. Some of the questions in thei
    9·1 answer
  • HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!