Java

posted by .

Can someone please help me out!!!I included what I have so far.

*Purpose
Implement a Java-method with three local int variables a, b, c, d and e that sorts these three values in ascending order by comparing and exchanging their values. At the end of the program a <= b <= c <= d <= e must hold.

  • Java -

    I think you need to suggest some code first for us to comment on.

  • Java -

    import java.util.Scanner;

    public class Q3 {

    public static void main(String[] args) throws Exception

    {

    int A,B,C,D;
    String result;
    Scanner reader= new Scanner(System.in);
    System.out.print("Enter value A : ");
    A=reader.nextInt();
    System.out.print("Enter value B :");
    B=reader.nextInt();
    System.out.print("Enter value C :");
    C=reader.nextInt();




    if (A>B)
    D=A;
    A=B;
    B=D;

    {
    System.out.println("Results is ");
    }




    }
    }

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. computer

    this isnt really a school question but i have a question about the sun java...it wouldnt load any of my games using it but whenever i deleted it and using the regular java...its working fine...it doesnt make any sense...please i hope …
  2. Computer Science

    //program that puts two lists in order in one single list with all the numbers in order import java.util.Scanner; public class listOrder { public static void main (String [] args){ int [] list1; int [] list2; int [] list3; int temp; …
  3. Computers

    //program that puts two lists in order in one single list with all the numbers in order import java.util.Scanner; public class listOrder { public static void main (String [] args){ int [] list1; int [] list2; int [] list3; int temp; …
  4. Java

    Is there a method in Java in which to see if an integer value contains characters?
  5. Computer Science-Java

    Hi, I am writing an application class for a Lunar Calendar I created in a service class and I have to make sure it is able to detect that the year entered is not in the range of values(I have done this in the service class using a …
  6. java

    Write the following methods and test them.this need to be execute it in Eclipse IDE for Java Developers 1. printVowels - this method should take a String as a parameter and print all the vowels contained in that String one character …
  7. JAVA PROGRAMMING

    "POWERS" Compute the power of a number given the base and exponent. Do three versions of this program using a while loop, a do-while loop and a for-loop. Introduction Please help..i don't know how to input this in java...please help.tnx
  8. Java Programming

    I need to create a pseudocode for the follwing application: Write Java-like pseudocode to specify the logic for the following program application: Write an application that prompts an employee for an hourly pay rate and hours worked. …
  9. computer science java

    write a program in java for a grocery (fruit shop calculate the prize of bananas @ $.89/kg declaring the the prices of all either as instances or class variables.declare the weight of the fruit as local variables
  10. Java programming

    Hi, I'm trying to figure out how to implement toString() methods into the JavaTest and H2ClassB classes so that the output would be 4 3 7 5 99 3: import java.util.ArrayList; public class JavaTest { ArrayList <JavaTest> list = …

More Similar Questions