answer.
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
natulia [17]
2 years ago
11

array of String objects, words, has been properly declared and initialized. Each element of words contains a String consisting o

f lowercase letters (a–z). Write a code segment that uses an enhanced for loop to print all elements of words that end with "ing". As an example, if words contains {"ten", "fading", "post", "card", "thunder", "hinge", "trailing", "batting"}, then the following output should be produced by the code segment.
Computers and Technology
1 answer:
Vlad [161]2 years ago
5 0

Answer:

for(String s:words)

   if(s.endsWith("ing"))

 System.out.println(s);

Explanation:

Create an enhanced for loop that iterates through the words array

Check if an element in words ends with "ing" using endsWith() method (Since it is said that strings are lowercase letters, we do not need to check it)

If you find one that ends with "ing", print the element

You might be interested in
Suppose the algorithms used to implement the operations at layer k is changed. how does this impact services at layers k-1 and k
yarga [219]
If the algorithm is changed for the operations at layer k, the services at k1 will change since the services will be operated after the layer. For the services at k-1, they will not be affected since they are prior to the algorithms.<span />
4 0
1 year ago
Which of the following commands uses correct syntax for matching the patterns bunk or bank at the end of a line of text?
Alika [10]

Answer:

a. grep 'b[au]nk$' myLine

Explanation:

grep is a command used for searching a specified pattern in a given text.

Our goal is to match the character sequence - bank or bunk at the end of line in a  given line referenced by myLine.

The regular expression for the specified match criterion is:

b[au]nk$

The second character can be either a or u.

$ indicates match at end of line.

So the overall grep command is :

grep 'b[au]nk$' myLine

8 0
2 years ago
Provide an example of each of the three primary information security areas: (1) authentication and authorization, (2) prevention
snow_lady [41]

Answer:

Explanation:

1. Authentication is a method for confirming users' identities. Once a system determines the authentication of a user, it can then determine the access privileges for that user. Authorization involves providing a user with permission, including access levels and abilities. For example file access, hours of access, and amount of allocated storage space.

2. Content filtering is a software organizations use that filters content, such as emails, to prevent the accidental or malicious transmission of unauthorized information. Encryption scrambles information into an alternative form that requires a key or password to decrypt. In a security branch, an intruder is then unable to read encrypted information. A firewall is hardware and/or software that guard a private network by analyzing incoming and outgoing information for the correct markings.

3. Intrusion detection software (IDS) features full-time monitoring tools that search for patterns in network traffic to identify intruders.

4 0
2 years ago
Leah wants to create a PowerPoint presentation for a history report about the progressive era in the 1900s. To
Nutka1998 [239]

Answer:

File

Explanation:

8 0
2 years ago
Read 2 more answers
Write a program FindDuplicate.java that reads n integer arguments from the command line into an integer array of length n, where
kozerog [31]

Answer:

  1. public class FindDuplicate{
  2.    public static void main(String[] args) {
  3.        Scanner input = new Scanner(System.in);
  4.        int n = 5;
  5.        int arr[] = new int[n];
  6.        for(int i=0; i < arr.length; i++){
  7.            int inputNum = input.nextInt();
  8.            if(inputNum >=1 && inputNum <=n) {
  9.                arr[i] = inputNum;
  10.            }
  11.        }
  12.        for(int j =0; j < arr.length; j++){
  13.            for(int k = 0; k < arr.length; k++){
  14.                if(j == k){
  15.                    continue;
  16.                }else{
  17.                    if(arr[j] == arr[k]){
  18.                        System.out.println("True");
  19.                        return;
  20.                    }
  21.                }
  22.            }
  23.        }
  24.        System.out.println("False");
  25.    }
  26. }

Explanation:

Firstly, create a Scanner object to get user input (Line 4).

Next, create an array with n-size (Line 7) and then create a for-loop to get user repeatedly enter an integer and assign the input value to the array (Line 9 - 14).

Next, create a double layer for-loop to check the each element in the array against the other elements to see if there is any duplication detected and display "True" (Line 21 - 22). If duplication is found the program will display True and terminate the whole program using return (Line 23). The condition set in Line 18 is to ensure the comparison is not between the same element.

If all the elements in the array are unique the if block (Line 21 - 23) won't run and it will proceed to Line 28 to display message "False".

7 0
1 year ago
Other questions:
  • What is one effective way for employees to keep their skillsets current?
    8·2 answers
  • Jane's organization recently experienced a security incident that occurred when malware set to trigger on the chief executive of
    13·1 answer
  • FTP requires confirmation that a file was successfully transmitted to a client, but it has no built-in mechanism to track this i
    5·1 answer
  • The kings and queens of England are listed in a relation Kings(name,nickname,house,beginReign,endReign). Their name is unique, e
    8·1 answer
  • How many times does the following loop execute?int upperCaseLetters = 0;String str = "abcdEfghI";boolean found = false;for (int
    5·1 answer
  • A news channel runs a two-minute story on phishing scams. The report features the testimonies of a phishing victim and a compute
    7·1 answer
  • Create a generic class Box with a type parameter that simulates drawing an item at random out of a box. This class could be used
    7·1 answer
  • Create a different version of the program that: Takes a 3-digit number and generates a 6-digit number with the 3-digit number re
    14·1 answer
  • Which is true regarding pseudocode
    8·1 answer
  • PLEASE HELP!!!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!