1answer.
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
zavuch27 [327]
3 years ago
6

Given the String variables name1 and name2, write a fragment of code that assigns the larger of the two to the variable first (a

ssume that all three are already declared and that name1 and name2 have been assigned values). (Note: "larger" here means alphabetically larger, not "longer". Thus, "mouse" is larger than "elephant" because "mouse" comes later in the dictionary than "elephant"!)
Computers and Technology
1 answer:
Neporo4naja [7]3 years ago
6 0

Answer:

if ( name1 > name2) {

    first = name1;

} else {

    first = name2;

}

Explanation:

First you need take a decision for that reason you need and if - else structure to decide if asign the variable name1 or the variable name2 to the result. Later you can use an > or < to compare two strings because it use the ASCII code to compare wich one is larger than another.

if ( name1 > name2) {

    first = name1;

} else {

    first = name2;

}

You might be interested in
P**nhub or x-videos or other
Colt1911 [192]
U shouldnt be watching them, Idc how old u are.
3 0
4 years ago
Handhed computer is otherwise called as<br> 1.laptop<br> 2.Notebook<br> 3.Palmtop
NikAS [45]

Answer:

personal digital assistants (PDAs)palmtop

3 0
3 years ago
Write an if else statement that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10. O
brilliants [131]

Answer:

if(a < 10)

{ b = 0; c = 1;}

else

{ b = -99; c = 0;}

Explanation:

4 0
3 years ago
What is a biometric scanner?
Lisa [10]
<span>an electronic device used to determine a person's identity by detecting and matching the person's physical features, such as fingerprints or the eyes, to a database</span>
3 0
4 years ago
Read 2 more answers
Software obtained illegally is called open-source software. true / false
Oxana [17]
False, software obtained illegally is called Pirated Software.
<span>Open source software is software developed by and for the user community, ie. Linux based software is Open Source.</span>
3 0
3 years ago
Other questions:
  • What is the correct order of network types when categorized by their size or the physical area they cover, from largest to small
    10·1 answer
  • Anyone want to join my dîšćòrd
    8·2 answers
  • How can i become an expert in computer and technology?
    15·2 answers
  • How has information technology made piracy possible
    14·1 answer
  • An equation that performs a calculation is a formula. True or false quest
    9·1 answer
  • What application service allows you to decouple your infrastructure using messaged based queues?
    10·1 answer
  • What factor(s) should be considered when determining whether a business is too far based on the query and the user location? Sel
    10·1 answer
  • Electricity fact topic
    10·2 answers
  • Please Helpppp Me User Interface Design ensures that the interface has elements that are easy to ________________. (Choose all t
    8·1 answer
  • How it/computing has impacted on engineering? <br><br> I need seven answers please help !
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!