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]
2 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]2 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
Tomahawk Industries develops weapons control systems for the military. The company designed a system that requires two different
mojhsa [17]

Answer:

<em>D. Separation of duties</em>

Explanation:

Separation of duties (SoD) is a fundamental concept in internal controls and is the hardest and often the most expensive to achieve.

<em>This aim is accomplished by distributing the tasks and associated permissions among multiple people for a specific security system.</em>

7 0
3 years ago
I want to know why almost every single "expert answer verified" thing I come across is wrong. If it's wrong, why the h is it exp
Studentka2010 [4]

Answer:

Because people just give out the verified things to the first person to answer their question

Explanation:

3 0
3 years ago
Read 2 more answers
Help ASAP!!Choose all the basic elements of algorithms. A.Selection B.Loops C.Flow Charts D.Sequencing E.Combinations F.Iteratio
serg [7]

Answer:

b c d

Explanation:

8 0
3 years ago
Read 2 more answers
In python please!! Write the definition of a function named countPos that needs integer values from standard input until there a
jek_recluse [69]

Answer:

Explanation:

The following code is written in Python it doesn't use any loops, instead it uses a recursive function in order to continue asking the user for the inputs and count the number of positive values. If anything other than a number is passed it automatically ends the program.

def countPos(number=input("Enter number: "), counter=0):

   try:

       number = int(number)

       if number > 0:

           counter += 1

           newNumber = input("Enter number: ")

           return countPos(newNumber, counter)

       else:

           newNumber = input("Enter number: ")

           return countPos(newNumber, counter)

   except:

       print(counter)

       print("Program Finished")

countPos()

8 0
3 years ago
What feature is not included in most DTP programs?
IceJOKER [234]
Features included in most DTP programs would be kerning, master pages, and WYSIWYG. S video editing isn't included in most programs for DTP
5 0
3 years ago
Other questions:
  • Camera shock might happen if you do which of the following to your camera?
    6·2 answers
  • ​PeroxyChem's IT staff was able to free its IT staff to spend less time on routine maintenance and more time on strategic tasks
    11·1 answer
  • for what reason do some security professionals consider insiders more dangerous than outside intruders?
    8·1 answer
  • Develop a Matlab program that allows you to plot the entropy of a source with variable output probabilities. We wish to observe
    8·1 answer
  • William found out that someone used his report on American culture without his permission. What is William a victim of?
    8·2 answers
  • 2 (01.01 LC)
    5·1 answer
  • Radio waves can be used to transmit energy. What is an advantage of this method in computer technology
    7·2 answers
  • If a file you are opening for appending does not exist, the operating system will detect the missing file and terminate the oper
    14·1 answer
  • Using C++
    13·1 answer
  • An analog video is a video signal transmitted by an analog signal, captured on a (blank)
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!