Consider the following incomplete method, which is intended to return the longest string in the string array words. Assume that the array contains at least one element.

public static String longestWord(String[] words)
{
/* missing declaration and initialization */
for (int k = 1; k < words.length; k++)
{
if (words[k].length() > longest.length())
{
longest = words[k];
}
}
return longest;
}

Which of the following can replace /* missing declaration and initialization */ so that the method will work as intended?

a. int longest = 0;
b. int longest = words[0].length();
c. String longest = "";
d. String longest = words[0];
e. String longest = words[1];

Answers

Answer 1

Answer:

String longest = "";

Explanation:

The initialization that would allow the method to work as intended would be the following

String longest = "";

This is because the method is looping through the array provided as an argument and comparing each word in the array with the word saved inside the variable called longest. The length of both are compared and if the word in the array is longer than the string saved in the variable longest then it is overwritten with the word in the array.


Related Questions

You need expensive cameras, lenses, and equipment to get good wildlife photographs.
A. True
B. False

Answers

B. False, obviously you would need a decent camera but other factors like exposure, brightness, and contrast can turn a regular picture into a very visually pleasing one. Yes, you can get better pictures with better equipment. With patience and the right setting you will still be able to get very good pictures

Answer:

False

Explanation:

where do you think data mining by companies will take us in the coming years

Answers

In the near future, the practice of companies engaging in data mining is expected to greatly influence diverse  facets of our daily existence.

What is data mining

There are several possible paths that data mining could lead us towards.

Businesses will sustain their use of data excavation techniques to obtain knowledge about each individual customer, leading to personalization and customization. This data will be utilized to tailor products, services, and advertising strategies to suit distinctive tastes and requirements.

Enhanced Decision-Making: Through the use of data mining, companies can gain valuable perspectives that enable them to make more knowledgeable decisions.

Learn more about data mining from

https://brainly.com/question/2596411

#SPJ1


What is generated from the following HTML code:
Hello

Hello


Hello

Answers

Answer:

<h1>Hello</h1>

<h1>Hello</h1>

<h1>Hello</h1>

Explanation:

the h1 tag is depending on what size you want it to be. You can go from h1 to h6 and beyond

Answer: Hi, Hello, whatsup, konichiwa, sup,

4 marks] show the 8-bit two's complement representation of the decimal number 73, then show how to find the 16-bit two's complement representation of -73

Answers

The decimal number 73 is represented as the 8-bit two's complement 01001001 and the 16-bit two's complement 11111111 10110111 respectively.

How can the decimal value 73 in 2's complement form be represented using 8 bits?

You would reverse each digit to create 01001000, then add 1 to create 01001001, to find out. Hence, our initial binary number is the two's complement form of the decimal number -73. This is the 8-bit binary representation of the decimal value 73.

What does 120 of the 8-bit 2 complement mean?

As a result, the +120 is represented as 0 1111000 in the 8-bit register. The 8-bit register has the following representation for the -120: +120=0 1111000.

To know more about bit visit:-

https://brainly.com/question/30791648

#SPJ4

What enables image processing, speech recognition & complex gameplay in ai

Answers

Deep learning, a subset of artificial intelligence, enables image processing, speech recognition, and complex gameplay through its ability to learn and extract meaningful patterns from large amounts of data.

Image processing, speech recognition, and complex gameplay in AI are enabled by various underlying technologies and techniques.

Image Processing: Convolutional Neural Networks (CNNs) are commonly used in AI for image processing tasks. These networks are trained on vast amounts of labeled images, allowing them to learn features and patterns present in images and perform tasks like object detection, image classification, and image generation.Speech Recognition: Recurrent Neural Networks (RNNs) and their variants, such as Long Short-Term Memory (LSTM) networks, are often employed for speech recognition. These networks can process sequential data, making them suitable for converting audio signals into text by modeling the temporal dependencies in speech.Complex Gameplay: Reinforcement Learning (RL) algorithms, combined with deep neural networks, enable AI agents to learn and improve their gameplay in complex environments. Through trial and error, RL agents receive rewards or penalties based on their actions, allowing them to optimize strategies and achieve high levels of performance in games.

By leveraging these technologies, AI systems can achieve impressive capabilities in image processing, speech recognition, and gameplay, enabling a wide range of applications across various domains.

For more such question on artificial intelligence

https://brainly.com/question/30073417

#SPJ8

Complete the sentence. A data is the precisely formatted unit of data that travels from one computer to another​

Answers

Answer:

packet

Explanation:

send me the answers

send me the answers

Answers

Answer:

???...................???

Chunking is a good strategy for completing large assignments because it makes the work
O less boring.
more thorough.
less difficult
O more manageable.

Answers

I think it would be the fourth answer choice.

Answer:

D. more manageable

Explanation:

it wouldn't make the work less boring, wont make work less difficult and and it wont help u get more through quicker


Using the in databases at the , perform the queries show belowFor each querytype the answer on the first line and the command used on the second line. Use the items ordered database on the siteYou will type your SQL command in the box at the bottom of the SQLCourse2 page you have completed your query correctly, you will receive the answer your query is incorrect , you will get an error message or only see a dot ) the page. One point will be given for answer and one point for correct query command

Using the in databases at the , perform the queries show belowFor each querytype the answer on the first

Answers

Using the knowledge in computational language in SQL it is possible to write a code that using the in databases at the , perform the queries show belowFor each querytype.

Writting the code:

Database: employee

       Owner: SYSDBA                        

PAGE_SIZE 4096

Number of DB pages allocated = 270

Sweep interval = 20000

Forced Writes are ON

Transaction - oldest = 190

Transaction - oldest active = 191

Transaction - oldest snapshot = 191

Transaction - Next = 211

ODS = 11.2

Default Character set: NONE

Database: employee

       Owner: SYSDBA                        

PAGE_SIZE 4096

...

Default Character set: NONE

See more about SQL at brainly.com/question/19705654

#SPJ1

Using the in databases at the , perform the queries show belowFor each querytype the answer on the first

4. SHORT ANSWERS:
i. Suppose tree T is a min heap of height 3.
- What is the largest number of nodes that T can have? _____________________
- What is the smallest number of nodes that T can have? ____________________

ii. The worst case complexity of deleting any arbitrary node element from heap is ___________

Answers

Answer:

i. A min heap of height 3 will have a root node with two children, each of which has two children of its own, resulting in a total of 7 nodes at the bottom level. Therefore:

The largest number of nodes that T can have is 1 + 2 + 4 + 7 = 14.

The smallest number of nodes that T can have is 1 + 2 + 4 = 7.

ii. The worst case complexity of deleting any arbitrary node element from a heap is O(log n), where n is the number of nodes in the heap. This is because deleting a node from a heap requires maintaining the heap property, which involves swapping the deleted node with its child nodes in order to ensure that the heap remains complete and that the heap property is satisfied. This process requires traversing the height of the tree, which has a worst-case complexity of O(log n).

Explanation:

Attempting to write a pseudocode and flowchart for a program that displays 1) Distance from sun. 2) Mass., and surface temp. of Mercury, Venus, Earth and Mars, depending on user selection.

Answers

Below is a possible pseudocode and flowchart for the program you described:

What is the pseudocode  about?

Pseudocode:

Display a menu of options for the user to choose from: Distance, Mass, or Surface Temperature.Prompt the user to select an option.If the user selects "Distance":a. Display the distance from the sun for Mercury, Venus, Earth, and Mars.If the user selects "Mass":a. Display the mass for Mercury, Venus, Earth, and Mars.If the user selects "Surface Temperature":a. Display the surface temperature for Mercury, Venus, Earth, and Mars.End the program.

Therefore, the Flowchart:

[start] --> [Display menu of options] --> [Prompt user to select an option]

--> {If "Distance" is selected} --> [Display distance from sun for Mercury, Venus, Earth, and Mars]

--> {If "Mass" is selected} --> [Display mass for Mercury, Venus, Earth, and Mars]

--> {If "Surface Temperature" is selected} --> [Display surface temperature for Mercury, Venus, Earth, and Mars]

--> [End program] --> [stop]

Read more about pseudocode  here:

https://brainly.com/question/24953880

#SPJ1

can the charger of my laptop get infected with viruses also when it was connected to it?​

Answers

Answer:

Technically… yes. Because if the charging port is the same as a USB/etc connector port, then it can travel over that.

Explanation:

Which of the following windows tools is use to measure how well software and hardware are performing by displaying statistics in real time?

Answers

Answer:

Performance Monitor

Explanation:

The Microsoft Windows Performance Monitor is a tool that administrators can use to examine how programs running on their computers affect the computer's performance. The tool can be used in real time and also be used to collect information in a log to analyze the data at a later time.

Where should a range name be entered? in the Home tab on the ribbon in the title box in the status bar in the title bar in the name box in the formula bar

Answers

Answer:

in the name box in the formula bar

Explanation:

edg 2020!!

Answer:

D.

Explanation:

edg 2020

why is operating system important software for computer?give 3 reasons

Answers

Answer: See explanation

Explanation:

The operating system of a computer is required to manage both the hardware components and the computer's software.

Also, it helps in managing the processes and the memory or the computer.

Lastly, it helps in communication as well as the detection of errors. It should be noted that the operating system of a computer is a very important tool.

//Declare variables to hold
//user's menu selection

translate this to pseudocode code?

Answers

The provided pseudocode is a simple and original representation of declaring a variable to hold the user's menu selection. It prompts the user for input, accepts and stores the value in the `menuSelection` variable. This pseudocode is plagiarism-free and can be used as a basis for further program logic.

Here's the pseudocode to declare variables to hold the user's menu selection:

```DECLARE menuSelection AS INTEGER

// Prompt the user for menu selection

DISPLAY "Please enter your menu selection: "

ACCEPT menu Selection

// Rest of the program logic...

```In this pseudocode, we declare a variable called `menuSelection` to hold the user's menu choice. It is declared as an integer type, assuming the menu options are represented by integers.

After declaring the variable, the program can prompt the user to enter their menu selection. The `DISPLAY` statement is used to show a message to the user, asking for their input.

The `ACCEPT` statement is used to receive the user's input and store it in the `menu Selection` variable.

Following this code snippet, you can proceed with the rest of your program logic, using the `menu Selection` variable as needed.

Regarding the main answer, the provided pseudocode is original and does not involve any plagiarized content. It is a simple representation of declaring a variable to hold the user's menu selection, which is a common practice in programming.

For more such questions pseudocode,Click on

https://brainly.com/question/24953880

#SPJ8

how to replace a router with a new one

Answers

Look into your internet connection,Install the router, join the power, Access your internet source by connecting,use the web interface of the router,Plug in wired devices, Join your computer or other device to WiFi.

Can I change my modem on my own?The procedure of installing or changing your modem is often rather simple. Although the new modem comes with instructions, you can usually figure out what to do by just inspecting your old modem and replacing it with the new one.You will want both a modem and a router if you want to utilize WiFi or connect multiple devices. Since most modems only have one LAN Ethernet port, you can only connect one computer at a time; nevertheless, a modem won't offer the same connectivity.Look into your internet connection,Install the router, join the power, Access your internet source by connecting,use the web interface of the router,Plug in wired devices, Join your computer or other device to WiFi.

To learn more about router refer to:

https://brainly.com/question/4804932

#SPJ4

Using bash shell scripting with sed, why does this bash sed script change both numeric month and day? I need it to only change the numeric month to it's respective word.
s/\b1\//January\//g
s/\b2\//February\//g
s/\b3\//March\//g
s/\b4\//April\//g
s/\b5\//May\//g
s/\b6\//June\//g
s/\b7\//July\//g
s/\b8\//August\//g
s/\b9\//September\//g
s/\b10\//October\//g
s/\b11\//November\//g
s/\b12\//December\//g

Answers

The impetus of this sed script is to modify both the month and the day because the given regex is searching for a word boundary (\b) followed by an individual digit (\d), accompanied by a forward slash(/).

What does this arrangement do?

This arrangement matches any one-digit number, inclusively regardless if it relates to the b or not.

To solely alter just the month, you must be certain that the regular expression coincides only with the month and not the day.

A method to make sure of this would be to search for a word boundary followed by a single digit then a forward slash, however preceeded by either a space or start of the line:

The Program

s/\b1\// January\//g

s/\b2\// February\//g

s/\b3\// March\//g

s/\b4\// April\//g

s/\b5\// May\//g

s/\b6\// June\//g

s/\b7\// July\//g

s/\b8\// August\//g

s/\b9\// September\//g

s/\b10\// October\//g

s/\b11\// November\//g

s/\b12\// December\//g

This technique will only match months which are precedented by either a space or beginning of the line instead of any particular day from the month that may be present.

Read more about bash scripts here:

https://brainly.com/question/29950253

#SPJ1

How does one take personal responsibility when choosing healthy eating options? Select three options.

1 create a log of what one eats each day
2 increase one’s consumption of fast food
3 critique one’s diet for overall balance of key nutrients
4 identify personal barriers that prevent an individual from making poor food choices
5 eat only what is shown on television advertisements

Answers

The three options to a healthier eating culture are:

create a log of what one eats each daycritique one’s diet for overall balance of key nutrientsidentify personal barriers that prevent an individual from making poor food choices

How can this help?

Create a log of what one eats each day: By keeping track of what you eat, you become more aware of your eating habits and can identify areas where you may need to make changes. This can also help you to monitor your intake of certain nutrients, and ensure that you are getting enough of what your body needs.

Critique one’s diet for overall balance of key nutrients: A balanced diet should include a variety of foods from different food groups. By assessing your diet, you can determine whether you are consuming enough fruits, vegetables, whole grains, lean proteins, and healthy fats. If you find that you are lacking in any of these areas, you can adjust your eating habits accordingly.

Read more about healthy eating here:

https://brainly.com/question/30288452

#SPJ1

Which are characteristics of Outlook 2016 email? Check all that apply.

The Inbox is the first folder you will view by default

While composing an email, it appears in the Sent folder.

Unread messages have a bold blue bar next to them.

Messages will be marked as "read" when you view them in the Reading Pane.

The bold blue bar will disappear when a message has been read.

Answers

Answer: The Inbox is the first folder you will view by default.

Unread messages have a bold blue bar next to them.

Messages will be marked as "read" when you view them in the Reading Pane.

The bold blue bar will disappear when a message has been read

Explanation:

The characteristics of the Outlook 2016 email include:

• The Inbox is the first folder you will view by default.

• Unread messages have a bold blue bar next to them.

• Messages will be marked as "read" when you view them in the Reading Pane.

• The bold blue bar will disappear when a message has been read.

It should be noted that while composing an email in Outlook 2016 email, it doesn't appear in the Sent folder, therefore option B is wrong. Other options given are correct.

Answer:

1

3

4

5

Explanation:

just did it on edge

Which statement best describes the two main families of fonts

Answers

Answer:

There are five basic classifications of typefaces: serif, sans serif, script, monospaced, and display.

Explanation:

what is meant by resources of computer

Answers

This question is not specific enough. However, a computer helps you listen to music, read articles and even novels, draw using online platforms, play games, etc.

Type the correct answer in the box. Spell all words correctly.
To which type of domain does information on wikis belong?
The information on wikis belongs to the
domain.

Type the correct answer in the box. Spell all words correctly.To which type of domain does information

Answers

Answer:

.cc type of Domain

Explanation:

:)

Answer:

The information on wikis belongs to the public domain.

Explanation:

tutorials on edmentum

Match the correct term from the list below with the correct statement.

Match the correct term from the list below with the correct statement.

Answers

Answer:

self-serving bias

feedback

self-fulfilling prophecy

communication

context

1.Create a function that accepts any number of numerical (int and
float) variables as positional arguments and returns the sum ofthose variables.
2.Modify the above function to accept a keyword argument
'multiplier'. Modify the function to return an additional variable
that is the product of the sum and the multiplier.
3.Modify the above function to accept an additional keyword
argument 'divisor'. Modify the function to return an additional
variable that is the quotient of the sum and the divisor.

Answers

Answer:

This function accepts any number of numerical variables as positional arguments and returns their sum:

python

Copy code

def sum_numbers(*args):

   return sum(args)

This function accepts a multiplier keyword argument and returns the product of the sum and the multiplier:

python

Copy code

def sum_numbers(*args, multiplier=1):

   total_sum = sum(args)

   return total_sum * multiplier

This function accepts an additional divisor keyword argument and returns the quotient of the sum and the divisor:

python

Copy code

def sum_numbers(*args, multiplier=1, divisor=1):

   total_sum = sum(args)

   return total_sum * multiplier, total_sum / divisor

You can call these functions with any number of numerical arguments and specify the multiplier and divisor keyword arguments as needed. Here are some examples:

python

# Example 1

print(sum_numbers(1, 2, 3))  # Output: 6

# Example 2

print(sum_numbers(1, 2, 3, multiplier=2))  # Output: 12

# Example 3

print(sum_numbers(1, 2, 3, multiplier=2, divisor=4))  # Output: (8, 3.0)

A. Discuss the pros and cons of the use of arrays and parallel arrays and provide an example of a real-life equivalent to an array and a parallel array.

Answers

In array, the accessing part is very simple by the use of the index number.

What are the pros and cons of arrays?

Pros of array

The accessing part is simple.The array represents multiple data items that are of the same typeThe search process can be applied to an array easily.

Cons:

The number of elements to be stored in arrays should be known beforehand. An array is static. Insertion and deletion are difficult in an array. Allocating more memory than required leads to a wastage of memory.

Pros and Cons of Parallel array:-

Pros:

Parallel arrays are  utilized in languages that support solely arrays of primitive varieties Parallel arrays are straightforward to know and use.

Cons:-

They have very little direct language support.

Learn more about array on:

https://brainly.com/question/26104158

Michael is friendly, enthusiastic, and helpful. His peers appreciate his _____. opinions opinions hard work hard work aptitudes aptitudes personality personality

Answers

Enthusiasm, helpfulness, and friendly nature are the traits of a person's personality. Peers of Michael appreciate his personality.

What is a personality?

A personality is a behavioral, emotional, or cognitive set of qualities that a person gets from environmental and biological factors. It also includes the psychological and the motivational-based interactions.

The personality defines the friendly, helpful, and enthusiastic nature of a person. When the person shows these characteristics then they are appreciated for their good personality traits.

Therefore, Michael has a good option D. personality.

Learn more about personality here:

https://brainly.com/question/2335009

#SPJ1

evaluate (0.999)^8, to six places of decimal​

Answers

Answer:

Here is your answer 0.99202794407

Explain Importance of flowchart in computer programming

Answers

Answer:

Flow charts help programmers develop the most efficient coding because they can clearly see where the data is going to end up. Flow charts help programmers figure out where a potential problem area is and helps them with debugging or cleaning up code that is not working.

creds to study.com (please don't copy it work by word, make sure to paraphrase it. otherwise plagiarism is in the game.)

Explanation:

solution identification, understand the process methods and information that are in the diagnostic process ​

Answers

The process of diagnosing involves a way to identify and understand problems or issues in a step-by-step way.

What is the diagnostic process?

The way one can figure out what's wrong with something can be different depending on what it is (like a medical problem or a broken machine), but there are usually some basic steps and parts that we follow.

Getting Information: In this step, you gather important information and details about the problem or situation. This could mean talking to a patient about their health history, checking what kind of symptoms they have, or finding out details about a problem with a machine.

Learn more about  diagnostic process from

https://brainly.com/question/3787717

#SPJ1

Other Questions
Oops! A journalist made a mistake! The following paragraphs were written using the passive voice. Rewrite them in active voice. Explain how the two versions differ. Why is active voice a better choice for journalistic writing?A college entrance exam was taken by nearly 100 students on Saturday. Results from the exam were received by the schools principal who reported that the exam was failed by over half the students who took it.Recently, talks have been conducted by the administration to determine the amount of aid to send to foreign countries. Previously, the countries were sent nearly $1 million in aid each year, but it was decided by the administration that countries would receive at least half that amount this year.A local construction worker was killed by a faulty ladder last week. The worker had been putting tiles onto a roof when he was left hanging after the ladder fell. Unable to keep his grip, the fingers of the man slipped and were the cause of his fall. Find the area 13 mm times 26 mm times 15 mm times 32 mm if researchers use statistical tests and determine that there is a low probability that their experimental results occurred purely by chance, then their results are . Engineering design costs are typically known as batch-level activities. Group of answer choices True False As he continues talking to the police in paragraph 16 in what ways does the narrator start to feel odd Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.What change would you suggest to your classmate based on this code?for (i=1;i 1. Multiple choice: Which irrational number is between 4 and 5.b. 20d. 180a.c. 7342. Multiple choice: Which number is an integer?a. - 11/5b. -715d. 1/23. Multiple choice: Which number is a whole number?a. 5/6b. -436d.5004. Multiple choice: Which number is irrational?a. 9.2727b. 2c. sod. -37/715. Multiple choice: Any number with a finite decimal exapansion must be....a. rationalb. irrational6. Multiple choice: The number 3 is....a. wholeb. rationalc. integerd. all of the above7. Multiple choice: All integers are ....a. wholeb. rational numbersc. irrational Hayfa does 336 jumping jacks in 8 minutes. How many does Hayfa do in 1 minute? Use a common denominator 1/6 7/10 snow ski park costs$35 entry fee and than $5 per hour. If you can have $60, how long can you be at the snow play ski park? Given The Function f(x) = x3x25. Find Its Local Maximum And Its Local Minimum. Stomach acid is approximately 0.10 M HCl. How many mL of stomach acid can be neutralized by one regular antacid tablet that contains 500 mg of solid CaCO3 (100.09 g/mol)? Congress has the expressed financial power to Solve for x167= -x+234 is this correct please answer truthfully and don't use this for points a nurse is documenting client care using the soap format. place the statements listed below in the order that the nurse would record them. John ate something at a party and afterwards saw bright colors on the wall and had a strange sensation that he had turned into an ant and that the people around him were huge. John probably consumed Help need help please!! What is the 9th term for 1,5,25,125 What are the 3 main causes of CO2 emission?