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
zavuch27 [327]
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. 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. That is, stdin = new Scanner(System.in); is given.
Computers and Technology
1 answer:
Darya [45]3 years ago
3 0

// Variable to keep track of array size

int length = 0;

// Array itself

int array[] = {};

// while loop will take input in the array until a negative number is entered

while(input>=0){

stdin = new Scanner(System.in);

array[length] = stdin;

length +=1;

}

// int variable to terminate while loop

int i =0;

// keep track of index of output array

int y =0;

while(arr[i] != length){

// making output array

int output[]={}; bool flag;

// put the element in out put array considering if it the desired one

output[y] = array [i];

// Now check if it was the desired?

for(int z=1;z<=length;z++){

if(array[i+z]!=output[y]){

 flag = true;

}

else

{

 output[y]=0;

 y+=1;

}

if(array[i+z+1]=output[y] && flag == true){

output[y] = array[i];

y+=1;

}

}

//output the array

for(int o=0;o<y;o++)

System.out.println(output[o];

You might be interested in
What is the importance of the international employment​
My name is Ann [436]

Answer:

People who went overseas to work can learn different skills and technologies which can be beneficial for the development of our own country.

7 0
3 years ago
Read 2 more answers
In many DBMSs where no strict separation of levels is maintained, this one language is used by the DBA and database designers to
marissa [1.9K]

Answer: False

Explanation:

This means that the mappings between the two schemas may be specified in either one of these languages.In most relational DBMSs today, there is no specific language that performs the role of SDL. Instead, the internal schema is specified by a combination of functions, parameters, and specifications related to storage. These permit the DBA staff to control indexing choices and mapping of data to storage

5 0
2 years ago
Berikan contoh perameter sebuah meja.​
lara31 [8.8K]

Answer:

The simplest of table parameters are rows, columns, page number, alternate row, column header, Table title, etc.

Explanation:

The simplest table parameter is as being mentioned above. Its, however, important to understand what are the parameters. Parameters are the features of an object that defines its behavior. Various parameters are the behaviors of the object hence, and here it is the table and the behavior of the table is being described with the parameters. There are so many other parameters that one can think of related to tables. And we should make a list of them for future studies. Font size, Font color, border, etc are some more from the huge list.

5 0
3 years ago
Generally, websites ending in .edu, .gov, and .org are less likely to be biased, or to show preference toward a certain financia
svetlana [45]

Answer:

True

Explanation:

Domain extensions always appear at the end of a website's address.

It's a means to categorise websites.

.edu domains are used for educational purposes

.gov are restricted to by government entities

.org is largely used by nonprofit websites.

While

.net is derived from the word network, indicating it was originally intended for organizations involved in networking technologies, such as Internet service providers and other infrastructure companies

.biz is intended for registration of domains to be used by businesses

The right domain extension adds credibility and memorability to your website by aligning it with a specific brand purpose.

8 0
3 years ago
Zadanie nr 1
Gennadij [26K]

Answer:

Explanation:

Rezonans, Obiekt bez wibracji ma tendencję do robienia tego z określoną częstotliwością zwaną naturalną lub rezonansową częstotliwością obiektu. (Ta częstotliwość zależy od wielkości, kształtu i składu przedmiotu). Taki przedmiot będzie silnie wibrował, gdy zostanie poddany wibracjom lub regularnym impulsom o częstotliwości równej lub bardzo zbliżonej do swojej częstotliwości naturalnej. Zjawisko to nazywa się rezonansem. Dzięki rezonansowi stosunkowo słaba wibracja w jednym obiekcie może powodować silne wibracje w innym. Analogicznie termin rezonans jest również używany do opisania zjawiska, w którym oscylujący prąd elektryczny jest wzmacniany sygnałem elektrycznym o określonej częstotliwości.

Przykład rezonansu zapewnia silnik, który powoduje wibracje mebla w innej części tego samego domu. Drgania te występują, ponieważ częstotliwość naturalna mebli jest równa częstotliwości drgań ustawianych przez silnik. Mówi się, że meble rezonują z silnikiem. Rezonans można również zaobserwować w samochodzie, gdy pewna popielniczka Partan, na przykład wibruje, gdy samochód jedzie z określoną prędkością. Popielniczka rezonuje z wibracjami silnika przy tej prędkości.

Rezonans mechaniczny może wytwarzać wibracje wystarczająco silne, aby zniszczyć obiekt, w którym występują. Na przykład żołnierze maszerujący nad mostem mogą wytwarzać ekstremalne wibracje z częstotliwością naturalną mostu i roztrzaskiwać go na części. Z tego powodu żołnierze przebijają się, by przejść przez most. W 1940 r. Podmuchy wiatru w Puget Sound Narrows w Tacoma w stanie Waszyngton spowodowały, że most wiszący wibruje z naturalną częstotliwością i most zawalił się.

W muzyce rezonans służy do zwiększenia intensywności (głośności) dźwięku. Na przykład stosunkowo słabe wibracje wytwarzane na końcu rurki organowej powodują, że kolumna powietrza w rurze wibruje w rezonansie, znacznie zwiększając głośność dźwięku. Zasada ta dotyczy także głosu ludzkiego, w którym wibracje strun głosowych są wzmacniane przez wibracje rezonansowe w kanałach ustnych i nosowych.

Rezonans elektryczny służy do strojenia radiotelefonów i telewizorów. Strojenie polega na ustanowieniu obwodu o częstotliwości rezonansowej równej przydzielonej częstotliwości żądanej stacji.

6 0
3 years ago
Other questions:
  • Why is the protocol down, even though you issued the no shutdown command for interface vlan 99?
    5·2 answers
  • How do you change brightness on acer laptop?
    7·1 answer
  • What is my favorite color?<br> Red<br>Orange<br>Yellow<br>Blue <br>Gold<br>Silver
    13·1 answer
  • Create an array named itemDescription containing the following item descriptions:
    15·1 answer
  • Match each term to the appropriate definition. DBMS data mining hash file index key field locking protocol relation roll back sc
    10·1 answer
  • Mrs. Patel uses a computer program to balance her checkbook. Which of the following best explains how the
    13·1 answer
  • How do you create multiple columns in Word?
    9·1 answer
  • A gui allows you to interact with objects on the screen such as icons and buttons true or false
    7·1 answer
  • Describe how you can use JavaScript to simulate the behavior of the placeholder attribute in older browsers
    8·1 answer
  • The main function of a(n) ____________________ is to centralize access control for the network by keeping an eye on both inbound
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!