in Education by
Write a program to store 10 names in an array. Arrange these in alphabetical orderby sorting. Print the sorted list.Take single word names, all in capital letters, e.g. SAMSON, AJAY, LUCY, etc. Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Java is a machine independent language which can work on any platform. Its an object oriented programming which stress on object rather than data. The main parts while doing Java programming are package, Class ,input variables, condition updating. Array is the representation of number of values of same data type. Sorting means arranging elements of array in ascending descending or any other specific order. import java . util. *; class arrange { public static void main(String args[]) { String n[] = new String[10]: String s=” “; int i, j; Scanner Sc=new Scanner(System . in); System . out. println(“Enter the names”); for(i=0;i<10;i++) { n[i] = sc . next(); } for(i=0;i<9;i++) { for(j=0;j<(9-i) ;j++) { if(n[j] . compareTo(n[j+1]>0) { s=n[j] n[j]=n[j+1] n[j+1]=s; } } System . out. println(“THE SORTED LIST IS”); for(i=0;i<10;i++) { System . out. println(n[i]); } } }

Related questions

0 votes
    Write a program to generate first 20 terms of Fibonacci series and store them in single dimension array. Display ... from the array Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Write a program to eliminate duplicates in a sorted array. in python Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    write a program to evaluate the arithmetic statement. X=A-B+C*(D*E-F)/G+H*K a) Using a general ... zero -address operation instruction. Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and ... present. Java class 10 Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    2.A feature of Microsoft Word which is used to create multiple copies of letters and e-mails is (a) Mail (b) ... merge (d) data source Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    Write a program to read name of 10 student from keyboard and arrange them alphabetically. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    write a program to print fibonacci series . write a program to search an element within the array using binary search Select the correct answer from above options...
asked Dec 29, 2021 in Education by JackTerrance
0 votes
    Single-word reference to viruses, worms etc. is– (a) harmware (b) virus (c) phish (d) malware (e) killer war Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    How many letters of the word FAINTS, will their order in the word and that when the letters are arranged in the alphabetical order, remain the same? A) Two B) One C) Three D) Nil...
asked Feb 12, 2021 in Education by JackTerrance
0 votes
    How to write a program in JAVA to print the sum of ASCII values of a particular word input ? Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    Write a program in JAVA to input a sentence reverse every word and print . Please answer someone. Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    write a Java program to input 10 non-zero numbers in an array and display the count of even and odd numbers. URGENT! Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Write a Numpy program to create an array to 10 zeros,10 ones,10 fives. Select the correct answer from above options...
asked Dec 12, 2021 in Education by JackTerrance
0 votes
    write a program to accept a word and display the new word after removing all the repeated alphabet Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    Write a c program to find largest and smallest among all elements of 2-d array. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
...