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
Where does the report footer section appear?
faltersainse [42]

The report footer section appear in pinnacle margin, even as the footer is a phase of the record that looks withinside the backside margin.

<h3>What is document footer access?</h3>

Add info in your Access shape or document with footers. If you've got got unique facts inclusive of an equation, date or time that does not in shape withinside the frame of your shape or document, you could upload it to a footer. Footers seem at the lowest of the file or the web page, relying at the alternatives you choose.

The Report Header, which prints as soon as on the pinnacle of the document, for the title. The Footer, which prints as soon as on the quit of the document, for combination totals.

Read more about the footer section:

brainly.com/question/1327497

#SPJ1

3 0
2 years ago
Which method would you use to get the value associated with a specific key and remove that key-value pair from the dictionary
ollegr [7]

Answer:

popitem

items

pop

list

Explanation:

5 0
2 years ago
A major ozone depletion happened in the 1900s. What was it caused by
melomori [17]
It was caused by air pollution and the extreme heat built up underneath it. <span />
3 0
3 years ago
Read 2 more answers
When you are using the internet to research a school project, and you ignore the banner ads on websites even though you see them
FinnZ [79.3K]

Answer:

The answer is "selective exposure".

Explanation:

It is a theory in psychology, that is sometimes used in marketing and advertising studies. It traditionally applies to the propensity of people to prefer evidence, that enhances existing previous views while ignoring conflicting information.

These types of approaches are occurring, when the people pursue knowledge and consistently express desires for solutions, that are associated with their beliefs, rather than incompatible.

5 0
3 years ago
Why is it that people say they “slept like a baby” when babies wake up like every two hours?
yKpoI14uk [10]

Answer:

Because babys sleep comfortable idiot.

6 0
3 years ago
Other questions:
  • What type of link is used to call this file
    11·1 answer
  • Which of these statements about cell references is NOT true?
    10·2 answers
  • Harry is undertaking a digital photography course as the college and wants to
    12·1 answer
  • If Tracy starts on the left edge of the canvas and moves forward 50 pixels, how many times will this code need to be repeated to
    5·1 answer
  • Q. Which protocol would best serve to authorize users to access directory services?
    8·1 answer
  • Since the rules cannot address all circumstances, the Code includes a conceptual framework approach for members to use to evalua
    8·1 answer
  • Describe from an administrator perspective what is necessary to prepare a storage device for access by a user.
    14·1 answer
  • Choose a problem that lends to an implementation that uses dynamic programming. Clearly state the problem and then provide high-
    10·1 answer
  • Determine whether the compound condition is True or False.
    14·1 answer
  • The ______ process retains copies of data over extended periods of time in order to meet legal and operational requirements.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!