Computers and Technology

Print the two strings in alphabetical order. Assume the strings are lowercase. End with newline. Sample output: capes rabbits import java. util. Scanner: public class OrderStrings { public static void main (String args) { String firstString: String secondString: firstString = "rabbits" secondString = "capes" /*Your solution goes here */ return: } }import java. util. Scanner;public class OrderStrings { public static void main(String[] args) { String firstString; String secondString; firstString = "rabbit"; secondString= "capes"; //String class in java provide string comparison function, use it, and get //your work done may even use brute force i. e using for loop and compare character by // character which will not good for the programming language which already have vast //predefined number of functions if(firstString. compareTo(secondString) < 0){ System. out. println(firstString + " " + secondString); } else{ System. out. println(secondString + " " + firstString); } return; }}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 20:30, winnie45
To display data in a certain manner like alphabetical order is called
Answers: 1
image
Computers and Technology, 22.06.2019 02:20, eagles2286
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
image
Computers and Technology, 22.06.2019 15:00, gmc2771
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
image
Computers and Technology, 22.06.2019 22:00, lgary9462
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass. cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array. c . run this program and observe the results.
Answers: 1
Do you know the correct answer?
Print the two strings in alphabetical order. Assume the strings are lowercase. End with newline. Sam...

Questions in other subjects:

Konu
Mathematics, 04.08.2019 18:00