function getLongestString(strings) { } /* Do not modify code below this line */ const strings = ['long', 'longer', 'longest']; console.log(getLongestString(strings), '<-- should be "longest"');

Answers

Answer 1

Answer:

function getLongestString(strings) {  

return strings.reduce( (acc, cur) => acc.length > cur.length ? acc : cur);

}

Explanation:

A reducer applies the same operation to each array element. In this case, the longest string is stored in the accumulator (acc), and is replaced only by the current element (cur) if the current element is longer than the accumulator.


Related Questions

How canwe measure the refresh rate of the CRT, Stereo Devices and LCD? Ifrefresh rate measurement of anyone is not possible then explainwhy?

Answers

Answer:

Refresh rate means how many times the image on the screen is redrawn in a second.It is measured in hertz.

We can measure refresh rate of all of the devices listed in the question.

CRT Refresh rate measurement:-

The refresh rate can be measured by dividing the scanning rate by count of horizontal lines multiplied by 1.05.

Stereo Devices Refresh Rate measurement:-

When LCD's are used for stereo 3 D displays, the refresh rate is divided by 2, because we have two eyes and each one needs a distinct picture. For this reason,it is suggested to use a display of at least 120 Hz refresh rate, because on divided by 2 this rate is 60 Hz.For example 70 Hz non-stereo is 140 Hz stereo, and 80 Hz non-stereo is 160 Hz stereo.

LCD Refresh rate measurement:-

Refresh rate of a LCD is the number of times per second in which the data it is being redrawn by the display.

You can print your report from the _______ tab.

A. Create
B. File
C. Add-ins
D. Arrange

Answers

Answer:

B. File

Explanation:

You can print your report from the file tab.  

The answer is B. File Tab

An entrepreneur mayfinance fixed assets by:

a. Inventoryloans

b. Installmentloans

c. Short-termdebt

d. Long-termdebt

Answers

Answer:

C - Short-term debt

Explanation:

Asset financing refers to using the company's fixed assets as leverage/collateral to borrow money through a loan. It is always used to address short-term capital requirements and would therefore be best done through short-term debt.

Do mouse cable connect to a PS/2 or USB port?

Answers

Answer:

USB port

Explanation:

A  mouse cable connects to a USB port.

You are able to remove it from your computer if needed and put it into a different computer or device.

What according to you a good software design?

Answers

Answer:  As software design is the part of Software development cycle (SDLC) it requires many factors to be become good and helpful such as:-

As it is a designing process it requires a update in the pattern and design so it should be able to deal with every change or update in the software that is being made.Software design should be able to support any modification in the design whenever it is required.By supporting the modification and updates in the design it makes it easy to save the time as well . So, it is also required that is should be a time saving process.

What is the advantage of breaking your application’s code into several small procedures?

Answers

Answer: For better code management and modularity

Explanation:

An application consist several lines of code so when we break an entire code into several small procedures it becomes easy to maintain and look for errors while debugging. This process also is part of good code writing and hence easy to manage our code during testing and debugging phases of application development.

Write the prototype for a function named showValues. It should accept an array of integers and an integer for the array size as arguments. The function should not return a value.

Answers

Answer:

void showValues(int [maximum volume],int);

Answer:

void showValues(int * array, int array_size){

int i;

for(i = 0; i < array_size; i++){

printf("%d\n", array[i]);

}

}

Explanation:

I am going to write the prototype of a function as a c code.

array is the array as an argument, and array_size is the argument for the size of the array.

void showValues(int * array, int array_size){

int i;

for(i = 0; i < array_size; i++){

printf("%d\n", array[i]);

}

}

x=10 ;
y= 15;
mystery (x,y);
void Mystery (int one , int two )
{
int temp;
temp = one;
one = one ;
two = temp;
}
3 What are the values ofx and y after thestatements above execute? (Assume that variables are properlydeclared.)
a.

x = 10; y = 10

c.

x = 15; y = 10

b.

x = 10; y = 15

d.

x = 15; y = 15

Answers

Answer:

The answer is x=10; y=15;

There is no change in the values of the variables x and y.

Explanation:

The integer variables x and y are initialized to 10 and 15 respectively as given.

x=10 ;

y=15 ;

The values of variables x and y are passed as parameters to another method, as shown.

mystery (x, y);

The mystery method given in the question is used to assign the same value to both the variables. The value of both the variables hold the value of x, i.e., both the variables hold the value of 10.

void Mystery ( int one , int two )  

{  

// temporary

int temp;  

// temp initialized to value of variable one which contains the value of variable x

// temp = x or temp = 10

temp = one;

// one is initialized to the value of itself or value of x

// one = x or one = 10

one = one ;

// temp is assigned value of variable x through variable one

// temp = 10

// y is also assigned value of temp variable

// y = 10

two = temp;  

}

As shown in the above steps, the mystery method is used to assign same values to variables one and two.

The values of original variables x and y are not affected since x and y are not utilized or called inside the mystery method.

This type of passing of parameters to a method can be described as passing a copy of the values of the parameters to the method.

Value of variable x is passed into variable one while value of variable y is passed into variable two.

Hence, values of variables one and two can be changed and modified without affecting the values of original variables x and y.

A batch file is a text file that used to enter a command or series of commands normally typed at the command prompt True False

Answers

Answer:

True

Explanation:

A batch file is a text file which either contains a single command or a series of commands normally typed at the command prompt for a computer operating system. It is known as a batch file because it bundles a set of commands into a single file which could have been presented to the operating system interactively using the keyboard one at a time. A batch file is generally created when a user needs to execute several commands together at a time. We can initiate the sequence of batch commands within the batch file simply by providing the name of the batch file on a command line tool.

Why must you be careful not to touch the gold contacts at the bottom of each adapter?

Answers

Answer: You must be careful to not touch the gold contacts at the bottom of the adapter because it might damage the device

Explanation: It is advised not touch the gold contacts of the adapter because that might damage the adapter by the oils present on the fingertips of a person which leads to corrosion at times and also there are chances of damage of the electronic component by the electrostatic discharge and that leads to the failure of the device .

Final answer:

To maintain electrical conductivity and prevent damage, avoid touching the gold contacts on adapters. Safety precautions and cleanliness are vital to protect the contacts from harmful materials. Preserving the integrity of the electrical connection is key to the proper functioning of the adapter.

Explanation:

It is crucial to be careful not to touch the gold contacts at the bottom of each adapter to prevent interference with electrical conductivity and avoid damaging the contacts. Gold is an excellent conductor of electricity, and touching the contacts with bare hands can introduce oils and dirt that may hinder the electrical connection.

Safety precautions such as wearing protective gear and ensuring clean hands are essential to prevent harmful materials from affecting the contacts and maintain the adapter's functionality.

The _______ controls the action of the algorithm. a. user b. plain text c. cipher text d. key

Answers

The _______ controls the action of the algorithm.

d. key

When a function simply receives copies of the values of the arguments and must determine where to store these values before it does anything else, this is known as a ____.
A) pass by value
B) pass by reference
C) stub
D) function declarator

Answers

Answer:

pass by value

Explanation:

Function is a group of statement which perform a task when it calls.

syntax:

type name(argument_1, argument_2,....)

{

 statements;

}

when the value is passed to function and then calling the function. it actually the copy of the value is passed and when the function perform the task and change the value passed it actually make changes i the copy not original value. This is called pass by value.

In order to be considered as an e-commerce web site the site must sell some tangible good. (true or false)

Answers

Answer:

False

Explanation:

The site can also exclusively buy items from people. Websites are not limited to selling items for they can also buy from users.

The following statement is false.

Why does a satellite requires two bridges?

Answers

Two bridges are being used in the satellite to avoid the delay in the communication of packets/Frames between the sites.

Explanation:

To avoid the delay in the communication of packets/Frames between the sites two bridges are being used. Two Ethernet connections can be connected using the bridge. NIC’s are not there in the repeaters whereas the bridge has two of them which make the bridge different than the repeater. On one of the side in the bridge process of addressing to the node is being done and other ends take care of communicating the packets.  

What symbol is used for an assignment statement in a flowchart?
Answer
a) processing
b) I/O
c) parallelogram
d) diamond

Answers

Answer:

processing

Explanation:

The flow chart is a diagram that shows the activity of the program, peoples or things.

Flowchart symbol and meaning in the options:

1. Processing: it is a rectangular shape block which is used for variable declaration or assignment.

2. I/0: it is a parallelogram in shape which is used for input or output.

3. Parallelogram: it is used for input or output.

4. diamond: it is used for decisions or conditions.

Therefore, the correct option is a. Processing is the one that is used for the assignment statement.

Final answer:

In a flowchart, the symbol used for an assignment statement is a parallelogram, which is different from symbols used for processes (rectangles) or decisions (diamonds).

Explanation:

The symbol used for an assignment statement in a flowchart is a (c) parallelogram. This shape is typically used to represent input or output operations, which includes assigning values to variables. In a flowchart, various symbols are utilized to represent different types of actions or steps in a process.

For example, a rectangle is often used for process or operation symbols, and a diamond shape is used to denote decision points. However, when it comes to depicting the action of assigning a value to a variable, which is a fundamental step in many algorithms and programs, the parallelogram serves this purpose.

True/False: When you make a function call, the order of the arguments you send does not matter as long as the number of arguments matches the number of parameters the function has. True False

Answers

Answer:

False

Explanation:

The order of arguments sent matters because what if you were trying to assign a int parameter as string, moreover there is one to one mapping and thus the results computed by the function will be wrong too. The order may cause a bug in the functionality (when the wrong value is assigned to the wrongly selected parameter due to alteration in order), cause run time errors ( when the data type of parameter and argument does not match due to alteration in order )

Write a program that takes two ints as input from the keyboard, representing the number of hits and the number of at bats for a batter. Then calculate the batter’s hitting percentage and check if the hitting percentage is above .300. If it is, output that the player is eligible for the All Stars Game; otherwise, output that the player is not eligible. Maintain floating point precision when calculating the hitting percentage.

Answers

Answer:

Hi!

// First you have to initialize the variables.

int hits = 0;

int atbats = 0;

float percentaje = 0;

function eligible() {

    hits = inputHits(); //  Function that input the hits.

    atbats = inputAtBats(); //  Function that input the at bats.

    percentaje = hits/atbats; //  Now, you can calculate the percentaje.

    if( percentaje > 0.300) { //If percentaje if greater than .300 will print Eligible for the All Stars Game.

         print('Eligible for the All Stars Game.');

          } else { //Otherwise will print Not elegible.

             print('Not elegible.');

         }

     }

}

Explanation:

List two advantages and disadvantages of having internationalstandards for network protocols?

Answers

Answer:

International standard is the process of standardizing the product and providing the product with same physical quantities and with high international level.

Two advantages and disadvantages of having international standards for network protocols are:

The main advantage of having the international standard for network protocol is that communication become easier as, all the computers are connected together. Easy to maintain and installation by using the same standard. Once a standard adopt worldwide, it is difficult to modify it if there is an issues are identified.Every standard has its limitation so that is why there is less focus on developing new technology.

When a company has international standards for network protocols, this means that the company applies the same rules and regulations to all network protocols, regardless of geographical location. There are several advantages and disadvantages of this method:

Advantages:

This allows the company to have a better control over its products, as it is easier to determine whether a network protocol has deviated from standards.

The international standards for network protocols allows for unity, which enables easier and more efficient communication.

Disadvantages:

It is difficult to implement a new international standard worldwide. Similarly, once successfully implemented, this is difficult to modify.

It is difficult to design the right international standard, as this has to be viable in a great variety of different situations and contexts.

What are 2 main differences betweenarrays andstructs?

Answers

Answer:

The two main differences between arrays and structures are as following according to me :-

1. Array is collection of data elements of same data type while a structure is collection of variables of different data types.

2.Array is a primitive data type while structure is a user defined data type.

There are other differences also which are as following:-

1. The size of array is fixed while the size of structure is not fixed as structure can contain different variables of different data types.

2.array is declared as following :-

int array [100];

where 100 is the size of the array means it can store up to 100 integer values.

struct class{

int roll_number;

char *name;

int admission_no;

};

3.Traversing and searching in an array is easy and fast while it is difficult and slow in structures.

In _______ view, you're unable to make changes to your report.

Answers

Answer:

In print view, you're unable to make changes to your report.

The answer is - Read Only

what is the largest possible number of internal nodes in a redblack tree with black height k? what is the smallest possiblenumber?

Answers

Answer:

A Red Black Tree is a type of self-balancing(BST) in this tree ,each node is red or black colored. The red black tree meets all the properties of the binary search tree, but some additional properties have been added to a Red Black Tree.

A Red-Black tree's height is O(Logn) where (n is the tree's amount of nodes).

In a red-black tree with black height k

The maximum number of internal nodes is [tex]2^{2k}[/tex] [tex]-1[/tex].

The smallest possible number is [tex]2^{k}[/tex] [tex]-1[/tex].

Final answer:

The largest possible number of internal nodes in a red-black tree with black height k is 2^(k+1) - 1, which assumes a completely filled tree. The smallest number of internal nodes is 2^k - 1, which represents a perfect black-height-balanced binary tree with no additional red nodes.

Explanation:

The largest possible number of internal nodes in a red-black tree with black height k is when each black node has the maximum number of children, which would be when both children are red. In this case, the maximum number of internal nodes is when we have a completely filled tree with alternating levels of red and black nodes, leading to a total of 2^(k+1) - 1 internal nodes, which includes both red and black nodes.

In contrast, the smallest possible number of internal nodes occurs when each black node has the minimum number of children, which is when it has two black child nodes or is a leaf node itself. In this scenario, the minimum number of internal nodes for a red-black tree with black height k is equal to the number of black nodes, which is 2^k - 1. This is because the tree would essentially be a perfect black-height-balanced binary tree without any additional red nodes.

In half-duplex communication between two hosts, both hosts can transmit, and both hosts can receive, but hosts cannot transmit and receive simultaneously.

a) True b) False

Answers

Answer:

True: In half Duplex communication both of the hosts can transmit and receive. But can not do both job simultaneously.

when one host is sending other one can receive but can not transmit. And the receiving host waits for the transmitting host to finish transmitting, before it starts transmitting from it's end.

When one host is receiving other one can transmit.

For example- The communication system of army people. when one person talks the person in the other end has to wait till he finishes. They can not talk simultaneously.

Explanation:

Where in full duplex the both hosts can transmit and receive simultaneously, in half duplex system that's not possible.

-Give a definition of the critical section problem and explain the purpose of the entry and exit code blocks

Answers

Answer: In operating system a code segment which accesses  some shared variables or resources one at a time atomically such other no other code or process is accessing that resource or variable at the same time.

Entry section code block allows the access to the shared resource or variable and exit section code signals the termination from access to the shared resource or variable.

Explanation:

Entry and exit section codes needs to check certain properties before allowing the access and removal of access to a particular code segment.

These conditions are:

1. Bounded waiting.

2. Mutual exclusion.

3. checking thread execution status to allows other threads to enter the critical section (CS).

. Consider a logical-address space of eight pages of 1024words each, mapped onto a physical memory of 32 frames.
a. How many bits are in the logical address?
b. How many bits are in the physical address?

Answers

Answer:

a)13 bits

b)15 bits

Explanation:

a)

It takes 10 bits to address within a 1024-word page because 1024= 2^10.

Since the logical address space is 8 = 2^3 pages,

We will add 10 bits for 1024 words

10 + 3 = 13 bits must be the logical addresses.

b)

There are 32 = 2^5 physical pages.

We will add 10 bits for 1024 words

Similarly, physical addresses are 5 + 10 = 15 bits long .

A database is a collection of ________ data.

A. reported
B. queried
C. object
D. related

Answers

Answer:

D. related

Explanation:

A database is a collection of related data.

Provide two examples from everyday life which apply sequential, conditional, and iterative operations.

Answers

Answer:

Explanation:

Great question, in everyday life we have hundreds of tasks that we complete daily which are one of these types of operations or various at the same time, For Example,

In the morning we wake up and make breakfast. The process to make eggs is a specific sequence. First you heat the pan. Then you add the eggs, next you condiment the eggs. Lastly, you place the eggs in a plate. This whole process is a sequential set of tasks.

Later on in the day you go to the car. If the car has gas you take the car to work. Otherwise you take the bus. This is a conditional event that depends of a certain variable to be present.

Yet Both of these events are iterative operations since they are repeated daily.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

Final answer:

Examples of sequential, conditional, and iterative operations in everyday life include following a recipe (sequential), a thermostat regulating temperature (conditional), and a washing machine going through its cycles (iterative).

Explanation:

Sequential, conditional, and iterative operations are fundamental concepts in computer programming and can be seen in everyday tasks. For instance, a recipe follows a sequential process, where one follows steps in a specific order, such as measuring ingredients, mixing them, and baking at a specific temperature for a set time. Conditional operations are seen in thermostats, which turn on heating or cooling systems if the temperature goes above or below certain points. Iteratively, a washing machine repeats cycles of filling, washing, and spinning until the clothes are clean. These examples reflect the application of programming logic in real-world scenarios and are instances where solving problems necessitates identifying knowns and unknowns, and ensuring answers are reasonable.

. Write a statement that throws an IllgalArgumentException with the error message Argument cannot be negative.

Answers

Answer:

public class PostAccount

{

  public void withdraw(float savings)

  {

     if (savings >=0 )

     {

        IllegalArgumentException exception

              = new IllegalArgumentException("Savings cannot be negative");

        throw exception;

     }

     balance = savings - withdraw;

  }

 }

Explanation:

IllgalArgumentException is a type of NumberFormatException  of runtime exception. Here in the program we have created an object of IllgalArgumentException class and after that we have thrown the error to show the condition if it does not satisfy the if condition.

Describe in one or more complete sentences how someone starting a computer repair business in a town night gain a competitive advantage in that town?

Answers

Answer:

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

Someone starting a computer repair business can gain a competitive edge in the town by offering both software and hardware repair. Some business offer either one or the other. While other big companies only offer repair for products that they own (Intel, AMD, dell, etc). Another way of getting an edge on competition is to offer computer related products such as graphic cards and motherboards. Most computer repair businesses do not do this.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

The way someone starting a computer repair business in a town night gain a competitive advantage is by selling related products.

What is competitive advantage?

Competitive advantage simply means the factors that allow a company have edge over its rivals.

In this case, the way someone starting a computer repair business in a town night gain a competitive advantage is by selling related products and quality products.

Learn more about competitive advantage on:

https://brainly.com/question/14030554

What is the binary system?

Answers

Answer:

In mathematics and digital electronics, a binary number is a number expressed in the base-2 numeral system or binary numeral system, which uses only two symbols: typically "0" and "1". The base-2 numeral system is a positional notation with a radix of 2. Each digit is referred to as a bit.

Answer:

The binary number system is an alternative to the decimal (10-base) number system that we use every day. Binary numbers are important because using them instead of the decimal system simplifies the design of computers and related technologies. ... But if the second digit is 1, then it represents the number 2.

Explanation:

An analog signal maintains a constant signal level for a period of time, then abruptly changes to a different constant level.

a) True b) False

Answers

Answer:

b) False

Explanation:

An analog signal does not maintain a constant signal level for a period of time, then abruptly changes to a different constant level.

Other Questions
Expected Value (50 points)Game: Roll two dice. Win a prize based on the sum of the dice.Cost of playing the game: $1Prizes: Win $10 if your sum is odd.Win $5 if you roll a sum of 4 or 8.Win $50 if you roll a sum of 2 or 12.Answer both question. Will give brainly.Explain HOW to find the expected value of playing this game. What is the expected value of playing this game? Show your work. (30 points)Interpret the meaning of the expected value in the context of this game. Why should someone play or not play this game. Answer in complete sentences. (20 points) Maria, Susan, and Bobby ran for class president. When the votes were tallied, Maria received 38 votes, Susan received 37 votes, and Bobby garnered 35 votes. According to Medvec and colleagues study of Olympic athletes emotional reactions, one would expect ____________ to be the LEAST happy with the election outcome. Please help!!!Estimate the value of \sqrt(14)+\sqrt(3) to the nearest hundredth. A. 3.79 B. 5.47 C. 2.01 D. 4.12 Given the following information about Elkridge Sporting Goods, Inc., construct a balance sheet for June 30, 2013. On that date the firm had cash and marketable securities of $25,135, accounts receivable of $43,758, inventory of $172,500, net fixed assets of $322,300, and other assets of $13,125. It had accounts payables of $67,855, notes payables of $36,454, long-term debt of $224,300, and common stock of $150,000. How much retained earnings did the firm have? On July 4, 1776, the Continental Congress issued which document? PLEASE ANSWER FIRST GETS BRAINLIEST!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Three kilograms of steam is contained in a horizontal, frictionless piston and the cylinder is heated at a constant pressure of 0.5 bar from 100 C to such a temperature that the specific volume increases by 2.5 times. If the amount of heat that must be added to accomplish this change is 500 kJ, calculate the final temperature of the steam, the expansion work, and the change in internal energy. Beauty Island Corporation began operations on April 1 by issuing 55,000 shares of $5 par value common stock for cash at $13 per share. In addition, Beauty Island issued 1,000 shares of $1 par value preferred stock for $6 per share. Journalize the issuance of the common and preferred shares. Suppose Pete was looking for a job for so long that he decided to give up looking for a job altogether. Pete has decided to retire and live with his parents. In the official statistics, Pete would be counted as _______. Which of the following best describes or defines a personality disorder? An enduring and rigidly pervasive pattern of behavior and experiences that is stable through time and leads to unhappiness, impairment and relationship difficulties. Experiences that deviate from cultural norms and cause changes in perception and coping mechanisms. Have an onset in late adulthood due to stress of financial concerns, marriage difficulty and child rearing. The inability to cope that leads to deviate behavior of the adolescent. Who were the member of the axis power Please help me.. What is the length of side x? 3.25 12 14.5 16 y varies inversely with x. When y = 3.6, x = 1.2. What is the value of k, the constant of inverse variation? Round to the nearest hundredth, if necessary. Read the passageShape it so that it is narrowest at the bottomKhianna wants to cite this passage in her essay, but wants to replace the first it withthe phrase "the hole" for additional clarification. Which choice best demonstrateshow Khianna should write the sentence in her essay?Shape the hole so that it is narrowest at the bottom.Shape it--the hole, I mean--so that it is narrowest at the bottom.Shape it (the hole) so that it is narrowest at the bottom.Shape it (the hole) so that it is narrowest at the bottom. What is the vertex of the graph of y = 5(x + 4)2 + 3? (1 point) 1/8 x3-1/27y3 please help ...factor ths expression completely, then place the factors in the proper location on the grid Where is the international criminal court located An indirect contact heat exchanger operating at steady state contains a shell with a single tube through it. The fluid flowing through the tube enters at 1kg/s with and enthalpy of 100kJ/kg. It exits with an enthalpy of 500kJ/kg. The fluid flowing through the shell enters with a mass flow rate of 4kg/s and an enthalpy of 1000kJ/kg. Determine the enthalpy at the exit of the shell. the point (3,0) lies on the graph of P(x)=x^3-7x^2+15x-9. True or False Para buscar el nmero de telfono de negocios uso____?