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
you type out a few sentences in an ms word file, and save it on your desktop. how is this data stored in the computer?
rosijanka [135]

When one is  typing on MS word and one save the file, this data would be stored as combination of 1s and 0s in the computer.

  • Computer data storage can be regarded complex system, immediately a data is saved then;

  • The first be converted to simple numbers of 1s and 0s , this number are very easy for a computer to store and these number are regarded as Binary Numbers and all letters as well as photographs are converted to numbers,

  • The hardware will record this saved numbers inside the computer.

  • These numbers are then  organized and transferred to temporary storage which be manipulated by programs, or software.

Therefore, data are been stored as 1s and 0s in the computer.

Learn more at:brainly.com/question/21571591?referrer=searchResults

8 0
3 years ago
Identify a computer language that is machine dependent.
Diano4ka-milaya [45]
<span>c. assembly language Let's look at the 4 choices and see why they work, or don't work for this question. a. extensible markup language - Otherwise known as XML, this is a markup language that's designed to allow data to be shared between different systems in a portable manner. HTML is a subset of XML. Definitely not machine dependent, so this is the wrong answer. b. structure query language - Otherwise known as SQL, this is a language used in defining queries to a remote or local database. It's intended so that the actual implementation of the database is unknown to the user and allows the user to write database queries in a portable fashion. Also not machine dependent, so this is the wrong answer. c. assembly language - This is a low level language specific to the CPU architecture. A program written for the x86 platform won't run on a 680x0 based machine and visa versa. A program written for SPARC won't run on an x86 machine. Assembly language programs tend to directly manipulate the hardware of the computer directly and are very machine dependent. This is the correct answer. d. high-level language - Some example languages would be C, C++, Basic, Algol, Pascal, etc. High level languages were developed so that programs could be easily moved over to other computers as newer more powerful computers because available. They also abstract details about the hardware so that the programmers don't need to know every single detail about the underlying computer. Purpose is to allow programs to be portable across multiple platforms with minimal to no effort. Not the correct answer.</span>
7 0
3 years ago
A programmer is trying to draw a red circle using python turtle functions. when she runs the program, it is drawing a lack circl
V125BC [204]

Answer:

Explanation:

One group of students did an experiment to study the movement of ocean water. The steps of the experiment are listed below.

Fill a rectangular baking glass dish with water.

Place a plastic bag with ice in the water near the left edge of the dish.

Place a lighted lamp near the left edge of the dish so that its light falls directly on the plastic bag.

Put a few drops of ink in the water.

The student did not observe any circulation of ink in the water as expected because the experiment had a flaw. Which of these statements best describes the flaw in the experiment? (2 points)

Not enough ink was added.

Not enough water was taken.

The dish was too small for the experiment.

The lamp and the ice bag were at the same place.

6 0
4 years ago
linnea is researching a type of storage that uses a single storage device to serve files over a network and is relatively inexpe
klio [65]

Considering the situation described above, the type of storage Linnea is researching is "NAS."

<h3>What is NAS in storage?</h3>

NAS is an acronym for Network Attached Storage. It is used as a file-level computer data storage server attached to a computer network.

NAS is usually applied in serving the files over Ethernet. It is cheaper and can be set up quickly.

<h3>Different Components of NAS.</h3>

Components of Network Attached Storage include the following:

  • CPU
  • Network Interface Cards
  • Operating System
  • NFS and CIFS protocol, etc.

Hence, in this case, it is concluded that the correct answer is NAS

Learn more about NAS here: brainly.com/question/25705115

6 0
3 years ago
A(n) ________ backup backs up only the files on a computer that have changed since the last time a backup was performed.
alekssr [168]

Answer:

incremental

Explanation:

An incremental backup backs up only the files on a computer that have changed since the last time a backup was performed.

3 0
3 years ago
Other questions:
  • When is cookies Useful or Inappropriate
    12·2 answers
  • The Zoom slider _____. a. allows you to change the way a document is printed b. is on the status bar c. is in the Zoom group on
    5·1 answer
  • Let's say that you're the sole IT person in your company, and your boss wants a way to block certain websites from employees. Wh
    6·2 answers
  • Consider a computer with identical interpreters at levels 1, 2, and 3. It takes an interpreter n instructions to fetch, examine,
    9·1 answer
  • Your company has decided to store data files in Cloud Storage. The data would be hosted in a regional bucket to start with. You
    12·1 answer
  • "A queue automaton is like a push-down automaton except that the stack is replaced by a queue. A queue is a tape allowing symbol
    14·1 answer
  • How does the team know what to work upon during the iteration? (1 correct answer)
    6·1 answer
  • Write a java program to create and display unique three digit number using 1,2,3 and 4 also count how many three digit number ar
    10·1 answer
  • it refers to the ability of different parts of a computer to work together as one. please answer this​
    6·1 answer
  • Why, during the final stage of the multistage model for e-commerce, is comprehensive customer information captured in the suppli
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!