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
NeX [460]
3 years ago
5

Write a filter that reads in a sequence of integers and prints the integers, removing repeated values that appear consecutively.

For example, if the input is 1 2 2 1 5 1 1 7 7 7 7 1 1 1 1 1 1 1 1 1, your program should print 1 2 1 5 1 7 1.
Computers and Technology
2 answers:
lara31 [8.8K]3 years ago
7 0

Answer:

Following is the code for filter:

public class filter

{ public static void main(String[] args)

{ int x = StdIn.readInt();

System.out.print(" " + x + " ");

while(!StdIn.isEmpty())

{ int y = StdIn.readInt();

    if(y != x)

          System.out.print(" " + y + " ");

    x = y;

    }

    }

    }

Explanation:

  • A public class filter is used.
  • The main function will accept a single argument as string[], it is also known as java command line argument.
  • Now the Stdln.readInt is used to read the integers in the sequence and store it in integer x.
  • The value stored in variable x will be printed using System.out.print
  • Now unless the Stdln.readInt gets an empty value, check each value of sequence and store in variable y.
  • If y is not equal to previous value x, print it and shift the value of y into x.
  • Repeat the loop again.

i hope it will help you!

kykrilka [37]3 years ago
4 0

Answer:

Computer

Explanation:

You might be interested in
What does the phrase at the drop of a hat mean?
umka2103 [35]

Answer:

When you use the expression 'At the Drop of a Hat' you mean that something is happening instantly, without any delay. Example of use: “We're all packed and ready to go; we can leave at the drop of a hat.”

Explanation:

Hope this helped!!  :)

Pls thank and maybe brainliest??

5 0
3 years ago
Read 2 more answers
7. Write a program in C to display the string "ARRAY" in the following format : A AR ARR ARRA ARRAY
Art [367]
This program will the string array in the given format.

int main(void){
char arr[6];
int counter;
strcpy(arr[], "ARRAY");

for(counter=0; counter<6; counter++){
printf("%c", arr[counter]);
}

return 0;
)

Note: Do not forget to include all the necessary library that is needed to run this program.

6 0
3 years ago
Fordham3 Hardware is known for its consensus buying center culture. Recognizing this corporate culture, someone attempting to se
balandron [24]

Answer: (c) focus exclusively on the head of the buying center.

Explanation:

As Fordham3 Hardware is known for its consensus buying center culture, so someone attempting to sell to Fordham3 should focus exclusively on the head of the buying center.

8 0
3 years ago
Necesito 7 innovaciones tecnológicas de la informática para 2021
Sonja [21]

‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍  ‍

3 0
3 years ago
For each policy statement, select the best control to ensure Ken 7 Windows Limited fulfills the stated requirements and also pro
elena-14-01-66 [18.8K]

Answer:

1. Option (a) is the correct answer. "Place a firewall between the Internet  and your Web server".

2.  Option (e) is the correct answer. "Require encryption for all traffic flowing into and out from the Ken 7 Windows environment".

3. Option (d) is the correct answer. "Implement Kerberos authentication for all internal servers".

4. The correct answer is option (g) "Require all personnel attend a lunch and learn session on updated network security policies".

5. Option (c) is the correct answer. "Enforce password complexity".

Explanation:

1. Users who tried to use ken 7 network resources for social media access will not be enable to do so.

2. Encryption for inflow and outflow of traffic from Ken 7 windows environment will monitor any personal devices which is connected to Ken 7 windows network.

3. The implementation of Kerberos authentication will deny anonymous users access to protected resources in Ken 7 infrastructure.

4.All personnel will be taught the network policies  to avoid sending report to unsecured printers.

5.  The more complex passwords are, the more secured the server will be. A complex password should be enforce for network security.

8 0
3 years ago
Other questions:
  • Sarah maintains a blog about her soap-making business, and she has hired someone to create a database for this business. She mak
    6·1 answer
  • Your boss asks you to work through the weekend to install new software on the applications server that serves up applications to
    15·2 answers
  • In Microsoft Word, spelling errors are identified by a _____.
    5·2 answers
  • The network architecture component that is a special LAN with a group of servers that enables electronic data exchange of betwee
    8·1 answer
  • Kiera is building a new computer and wants to make sure she has an adequate power supply for all the new equipment she is purcha
    15·2 answers
  • How will you apply what you have learned in our topic today in a real life situation? Show your answers in the acronyms provided
    6·1 answer
  • Carbon copy others who are..
    14·2 answers
  • When citing an Internet source:__________. a. it is ok to omit quotation marks if you change some words in the original sentence
    8·1 answer
  • Greg wants to check the amount of requests his website receives. What test can he use?
    6·1 answer
  • A swimming pool has a length of 28 feet, a width of 17 feet, and a depth of 6 feet. How much water can the swimming pool hold?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!