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
sertanlavr [38]
3 years ago
6

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 is consi

dered a CONSECUTIVE DUPLICATE. 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.
Computers and Technology
1 answer:
Bas_tet [7]3 years ago
5 0

Answer:

int firstNumber, secondNumber, duplicates;

secondNumber = duplicates = 0;

firstNumber = stdin.nextInt();

while (stdin.hasNextInt() && firstNumber > -1 && secondNumber > -1)

{

   secondNumber = stdin.nextInt();

   if (firstNumber == secondNumber)

   {

       duplicates++;

   }

   firstNumber = secondNumber;

}

System.out.println(duplicates);

Explanation:

The code is in JAVA.

You might be interested in
You should reach across something to lift a load is this true or false
Grace [21]

Answer:

False. Never reach across a load when you're trying to lift it.

3 0
3 years ago
A computer with 5 stage pipeline like the one descrive in class delas with conditional branches by stalling for the next three c
trasher [3.6K]

Answer:

It hurts 80%

Explanation:

7 0
4 years ago
Which for loop will iterate 100 times? Group of answer choices for (i = 0; i < 99; i++) for (i = 1; i < 99; i++) for (i =
cupoosta [38]

Answer:

for (i = 0; i < 100; i++);

Explanation:

8 0
3 years ago
Read 2 more answers
We assume that ABC Corporation has two business offices. These offices are in the cities of Orlando and Miami. These cities are
murzikaleks [220]

Answer:

The following are the answer to the given points:

Explanation:

In point (a):

Calculating the long-distance call cost:

= 4 \times 5 \times 0.40 \\= 20 \times 0.40\\= 8

Calculating the local call cost:

= 10 \times 3  \times 0.05\\ = 30 \times 0.05\\= 1.5

Calculating the overall cost of PSTN:

= 25 + (4 \times 5 \times 0.40) + (10 \times 3 \times 0.05) + 2000 + 275 \\= 25 + 8 + 1.5 + 2000 + 275 \\=   2309.5

In point (b):

Calculating the call rate per second and the average arrival rate:

\to (\lambda) = 0.2

The call average length:

\to (T_s) = - 8  \\\\ = (8  \times 60) \ seconds \\\\ = 480 \ seconds  

The complete agent number:

\to  (m) = 9

The strength of traffic:

\to u = \lambda \times  T_s  \\\\  =   (0.2  \times 480) \\\\ = 96    

The occupancy of the agent:

\to  p = \frac{u}{m}  \\\\

      = \frac{96}{9}  \\ \\= 10.66  

Calculation of obtained:

= \frac{(\frac{um}{m!})}{(\frac{um}{m!})} + (1-p) \sum {m-1} _{k=0}  \ \frac{uk}{k!}

We get = 0.329 to substitute values.  

In point (c):

The rate of blocking = 5 \%

average call time (T_s) = 480 \ seconds

                                    = 0.05 \times  480 \ seconds \\  = 24 \ second

In point (d):

Calculating the number of link, which is required:  

= \frac{275}{5} \\\\ =55

In point (e):

Calculating the Line Number:

= \frac{275}{5} \\\\ =55

PSTN line number:

=  (\frac{2000}{55}) \\\\ = 36.3636\\\\= 37

In point (f):

The gross design expense = $ 2309. 5

5 0
4 years ago
According+to+gartner+research,+by+2020,+_____+will+be+the+greatest+source+of+competitive+advantage+for+30%+of+organizations.
pentagon [3]

According to Gartner Research, by 2020, digital dexterity will be the greatest source of competitive advantage for 30% of organizations.

Organizations are under increasing pressure to keep up with the ever-changing digital landscape. To stay ahead of the competition, many are turning to digital dexterity as a source of competitive advantage.

Gartner Research predicts that by 2020, digital dexterity will be the greatest source of competitive advantage for 30% of organizations. To achieve digital dexterity, organizations need to be able to rapidly adapt to changing market conditions and technologies.

To stay ahead of the competition, organizations need to invest in training and development programs that will help employees stay up-to-date with the latest digital trends. Additionally, organizations need to create a culture of innovation that encourages employees to experiment with new technologies and ideas.

By 2020, digital dexterity will be a critical source of competitive advantage. Organizations that are able to effectively harness the power of digital technology will be well-positioned to succeed in the future.

Learn more here:

brainly.com/question/17178886

#SPJ4

7 0
2 years ago
Other questions:
  • #Imagine you're writing a program to check if a person is
    8·1 answer
  • Clifford created a table using OpenOffice Writer and entered some information into the table. Later, he needed to add more rows
    15·2 answers
  • Keep getting the message i failed to sign in to email on my phone but i can open my email. whats going on?
    10·2 answers
  • Which operating system is used by most desktop and laptop computers?
    5·1 answer
  • Which of the following represents the TCP/IP four-layer reference model? Group of answer choices Application, Internet, transpor
    11·1 answer
  • Multiple Choice
    5·1 answer
  • I WILL GIVE BRAINLIEST
    9·1 answer
  • Question
    5·1 answer
  • Will give brainliest
    14·1 answer
  • PYTHON --- Toll roads have different fees based on the time of day and on weekends. Write a function calc_toll() that has three
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!