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
pashok25
1 month 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:
oksian1 [950]1 month ago
5 0

Answer:

for(String s:words)

   if(s.endsWith("ing"))

 System.out.println(s);

Explanation:

Execute an enhanced for loop to go through the words array

Verify if any word in the array ends with "ing" using the endsWith() function (Given that strings are lowercase letters, no additional checks are necessary)

If a word ending with "ing" is found, print it.

You might be interested in
Sushant is a new manager and he wants to share his ideas and working protocol with his team.Compare the advantages and disadvant
oksian1 [950]

Answer:

Benefits of Oral Communication

  1. Utilizing visual aids such as PowerPoint during discussions can enhance his team's understanding of his concepts and procedures.
  2. Staff responses tend to be more immediate and sincere compared to written replies.

Drawbacks of Oral Communication

  1. If Sushant struggles with stage fright or lacks strong communication skills, it may negatively impact the team's perception of him.
  2. There is a risk that staff may forget portions of Sushant's spoken communication, as written information is generally more reliable for retention.

Benefits of Written Communication

  1. A well-crafted memo articulates Sushant's ideas and procedures clearly to the staff.
  2. A feedback questionnaire could be included for staff input.
  3. Clearly stated goals and objectives.

Drawbacks of Written Communication

  1. Excessively lengthy written material may pose challenges for comprehension or retention.

It is advisable for Sushant to prioritize written communication to share his ideas and protocols effectively.

3 0
2 months ago
Write a code segment to change the name of the Thing object something such that the new name consists of the old name with one c
oksian1 [950]

Answer:

import random

def name_change( name: list ) -> list :

   choice = random.choice( name )

   choice_index = name.index( choice )

   name.pop( choice_index )

   return name

Explanation:

The provided Python code utilizes the random library to randomly select an item from a list within the function "name_change". The index of the selected item is then retrieved from the list and removed from the original list called "name", with the modified name subsequently returned.

To activate the function, assign it to a variable, supply a list (it must be a list) as its argument, and then express the result.

6 0
2 months ago
Compute the approximate acceleration of gravity for an object above the earth's surface, assigning accel gravity with the result
maria [1035]

Response:

Written in Python

G = 6.673 *pow(10,-11)

M = 5.98 *pow(10,24)

d = float(input("Enter distance: "))

g = (G * M)/(pow(d,2))

print("Calculated gravity acceleration: "+str(g))

Explanation:

The following line sets the gravitational constant

G = 6.673 *pow(10,-11)

This line establishes the mass of the Earth

M = 5.98 *pow(10,24)

This prompts the user to input the object's distance

d = float(input("Enter distance: "))

This calculates the gravity exerted on the object

g = (G * M)/(pow(d,2))

This line outputs the gravity acceleration without rounding

print("Calculated gravity acceleration: "+str(g))

8 0
2 months ago
Given main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is:teamWins / (teamWin
amid [951]

Answer:

Explanation:

public class Team {

   private String teamName;

   private int teamWins;

   private int teamLosses;

   public String getTeamName() {

       return teamName;

   }

   public void setTeamName(String teamName) {

       this.teamName = teamName;

   }

   public int getTeamWins() {

       return teamWins;

   }

   public void setTeamWins(int teamWins) {

       this.teamWins = teamWins;

   }

   public int getTeamLosses() {

       return teamLosses;

   }

   public void setTeamLosses(int teamLosses) {

       this.teamLosses = teamLosses;

   }

   public double getWinPercentage() {

       return teamWins / (double) (teamWins + teamLosses);

   }

}

7 0
1 month ago
Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels
maria [1035]

Response: 1,500,000 bytes.

Clarification:

If we assume the image dimensions are 4000 pixels in width and 3000 pixels in height, the total uncompressed image will consist of 4000*3000= 12,000,000 pixels.

In the case of a binary image, each pixel can have only two values, which necessitates one bit for each pixel.

This indicates that we need to accommodate 12,000,000 bits.

Given that 1 byte equals 8 bits.

So, to store an uncompressed binary image sized 4000 x 3000 pixels, 12,000,000/8 bytes is required ⇒ 1,500,000 bytes.

3 0
1 month ago
Other questions:
  • Which of the following statements is true regarding input and output?
    12·2 answers
  • Write a function solution that returns an arbitrary integer which is greater than n.
    13·1 answer
  • Explain why the cost of ownership may be lower with a cloud database than with a traditional, company database.
    9·1 answer
  • Charlie has a large book collection. He was keeping track of it in a spreadsheet, but it has grown big enough that he wants to c
    10·1 answer
  • Write a program to help you feed your friends at a party by doing some math about square pizzas. Assume the grader defines a str
    12·1 answer
  • A large organization is struggling to close the gaps in skill levels that exist between its employees and those from competing c
    11·1 answer
  • Assign to avg_owls the average owls per zoo. Print avg_owls as an integer. Sample output for inputs: 1 2 4 3
    7·1 answer
  • A wireless network does not benefit like a wired network does, when it comes to collision reduction. Which device reduces collis
    6·1 answer
  • In 2007, this wireless security algorithm was rendered useless by capturing packets and discovering the passkey in a matter of s
    6·2 answers
  • Define a new object in variable sculptor that has properties "name" storing "Michelangelo"; "artworks" storing "David", "Moses"
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!