Given the string variables name1, name2, and name3, write a fragment of code that assigns the largest value to the variable max (assume all three have already been declared and have been assigned values).
if (name1.compareTo(name2)>0)
max = name1;
else
max = name2;
if (name3.compareTo(max)>0)
max = name3;

Respuesta :

A string is a collection of characters that can be used in any computer programming language to represent text.

What is meant by string function?

A string is often regarded as a data type and is frequently implemented as an array data structure made up of bytes (or words) that uses character encoding to hold a sequence of components, typically characters. Additionally, the term "string" can refer to more general arrays or other sequence (or list) data types and structures.

A string is a group of characters used to represent text in any language used for computer programming. The String object in JavaScript is a container for a String primitive, which is one of the primitive values.

You can use string functions to build expressions in Access that change text in a variety of ways.

max=name1;   //define variable max that holds name1 variable value.

if (strcmp(name2, max)>0)  //if block.

{

  max=name2;  //assign value to max.

}

if (strcmp(name3,max)>0)   //if block.

{

 max=name3; //assign value to max.

}

To learn more about string function refer to:

https://brainly.com/question/28290531

#SPJ4

ACCESS MORE