Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners read a positive real numbers from highest to lowest
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


vonn
read a positive real numbers from highest to lowest
1 Answer(s)      3 years and 8 months ago
Posted in : Java Beginners


write a java program that will read a sequence of 10 positive real nos. entered by the user and will print the same numbers in sorted order from lowest to highest using arrays .

PLEASE NEED HELP ,STUCK WITH THIS :(


Advertisement
View Answers

April 25, 2011 at 1:20 PM


import java.util.*;
class ArraySort{
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.println("Enter positive real numbers: ");
        Integer array[]=new Integer[10];
        for(int i=0;i<array.length;i++){
            array[i]=input.nextInt();
        }
        System.out.println("Sorted Array in reverse order:");
        Arrays.sort(array,Collections.reverseOrder());
        for(int i=0;i<array.length;i++){
            System.out.println(array[i]);
        }

    }
}


Related Tutorials/Questions & Answers:
read a positive real numbers from highest to lowest
read a positive real numbers from highest to lowest  write a java program that will read a sequence of 10 positive real nos. entered by the user and will print the same numbers in sorted order from lowest to highest using arrays
Sum of positive and negative numbers
]; } } System.out.println("Sum of positive numbers: "+sum2); System.out.println...Sum of positive and negative numbers  Hi if someone could help that would be great Write a program to read in 10 integer values and output
Advertisements
determine the top 10 highest and 10 lowest in java
determine the top 10 highest and 10 lowest in java  hello, I have a case, where there are tables in the database and have a file borrowing that contains the codebooks and namesmembers. I want to make 10 the highest rank anyone
c++ array find the average mark, highest mark, lowest mark, number of students passing,
c++ array find the average mark, highest mark, lowest mark, number of students passing,    i need help in adding the c++ code for the average mark, highest mark, lowest mark, number of students passing, using array. 01
c++ array find the average mark, highest mark, lowest mark, number of students passing,
c++ array find the average mark, highest mark, lowest mark, number of students passing,    i need help in adding the c++ code for the average mark, highest mark, lowest mark, number of students passing, using array. 01
3rd&5th highest salary from a table
3rd&5th highest salary from a table  how we get 3rd highest and 5th highest salary from a table
ask user how many numbers to be inputted and determine the sum and highest number using an array in java
ask user how many numbers to be inputted and determine the sum and highest number using an array in java  ask user how many numbers to be inputted and determine the sum and highest number using an array in java
to read number from user
to read number from user  1)print the positive equivalent of the number 2) check if the no is integer or not 3) find the square root of the number 4) find the cube of the number
Prime Numbers from range
Prime Numbers from range  how to find prime numbers in a given range which are palindromes??   Hi Friend, Try the following code: import java.util.*; public class PrimeAndPalindrome { static final int MAXNUMBER
Check whether highest number is even or odd
Check whether highest number is even or odd In this section, you will learn how to check highest number between the two numbers and then determine whether... the highest number.After getting the highest number, we have created a condition
Read from file java
Read from file java  How to Read from file java? What is the best method for a text file having a size of 10GB. Since i have to process the file one line at a time so tell me the very best method. Thank you
Generate random numbers from 1 to 100
Generate random numbers from 1 to 100  1)A class Called: RandomNumberGenerator that generate random numbers from 1 to 100 2)A class Test that tests... an object from the Random NumberGenerator class to generate your input test data
how to read from dictionary c
how to read from dictionary c  how to read elements from dictionary in c programming
Find HCF of three numbers in Java Program
Find HCF of three numbers in Java Program In this java tutorial section, you will learn how to determine the HCF (Highest Common Factor) or GCD (Greatest Common Divisor) of three numbers. As you already know that HCF or GCD 
numbers
numbers  Write a program that read 15 integers between 0 and 6 and a method to search, displays and returns the number that has the highest... " + list1.get(index)+ " has highest occurrence i.e " + maxCount
Read from a window - Java Beginners
Read from a window  HI, I need to open a website and read the content from the site using Java script. Please suggest. Thanks
read data from Excel sheet
read data from Excel sheet  Hi, How to read data from an excel sheet using JSP. Thank you
Read Property file From Jmeter
Read Property file From Jmeter  Hi, I am running web driver script from Jmeter, but while reading property file I am getting "File Not Find Exception". Please tell me how to read ".properties" file from Jmeter
Read Lines from text file
Read Lines from text file  Here's a brief desc of what my Java code does .. I'm using BufferedReader to read lines from a text files and split each... read from the text file and displays the output as desired. Unable to read the rest
Java read lines from file
Java read lines from file  Any code example related to Java read lines from file? In my project there is requirement of reading the file line by line... to read the whole file in one go. So, in my case reading file line by line is only
JDBC : Find Lowest salary
JDBC : Find Lowest salary In this tutorial, we are showing how to find record of lowest salary in table employee. MIN() : MIN() method returns the lowest value of the specified field. So when you want to get lowest value of any
Read the value from XML in java
Read the value from XML in java  Hi, i have an XML with the following code. I need to get the path("D... the permissions on that file.So how can i read that value. This is little urgent
Pick Prime Numbers from the ArrayList
Pick Prime Numbers from the ArrayList Programmers mostly used ArrayList... integer values in the arraylist and from the arraylist we have to find the prime and non prime numbers separately. Here is the code: import java.util.
how to read values from java in xml?
how to read values from java in xml?  how to read values from java in xml
Read Cookies from Servlet
Read Cookies from Servlet       This section illustrates you how to read cookies from Servlets. The Cookie Class provides an easy way to read Cookies. You can use getCookies() method
Create a web application using java technology to display 10 most relevant tweets from Twitter in real-time for the keyword
Create a web application using java technology to display 10 most relevant tweets from Twitter in real-time for the keyword   Create a web application using java technology to display 10 most relevant tweets from Twitter in real
web application using any technology to display 10 most relevant tweets from Twitter in real-time
web application using any technology to display 10 most relevant tweets from Twitter in real-time  web application using any technology to display 10 most relevant tweets from Twitter in real-time
Create a web application using any technology to display 10 most relevant tweets from Twitter in real-time for the keyword
Create a web application using any technology to display 10 most relevant tweets from Twitter in real-time for the keyword   Create a web application using any technology to display 10 most relevant tweets from Twitter in real
read excel file from Java - Java Beginners
read excel file from Java  How we read excel file data with the help of java?  Hi friend, For read more information on Java POI visit to : http://www.roseindia.net/java/poi/ Thanks
JDBC : Find second highest salary
JDBC : Find second highest salary In this section you will learn how to get record of employee having second highest salary. Find second highest salary : For finding the highest salary you can directly use MAX(salary) function
JDBC : Find Third highest salary
JDBC : Find Third highest salary In this section you will learn how to get record of employee having second highest salary. Find Third highest salary : For finding the highest salary you can directly use MAX(salary) function
Advertisements
 

 

 

DMCA.com