Ask Experts Questions for FREE Help !
Ask
    HRida's Avatar
    HRida Posts: 1, Reputation: 1
    New Member
     
    #1

    Oct 23, 2011, 02:18 PM
    Did it in C how I can make it in JAVA
    //the question is below at final

    Package assignment2_1;
    Import java.util.Scanner;
    Public class Assignment2_1
    { public static void main(String[] args)
    {
    System.out.println("Enter your 3 numeric values");

    System.out.println("Note: this program purpose is to find the minimum and maximum value of what you enter");
    Scanner scan= new Scanner(System.in);

    int firstNumericValue,secondNumericValue,thirdNumericV alue;

    System.out.println("Enter your first numeric value:");
    firstNumericValue=scan.nextInt();

    System.out.println("Enter your second numeric value:");
    secondNumericValue=scan.nextInt();

    System.out.println("Enter your third numeric value:");
    thirdNumericValue=scan.nextInt();
    int max,min;
    if((firstNumericValue>secondNumericValue)&&(firstN umericValue>thirdNumericValue)&&(secondNumericValu e>thirdNumericValue))
    {
    max=firstNumericValue;
    min=thirdNumericValue;
    }
    Else if((firstNumericValue>secondNumericValue)&&(firstN umericValue>thirdNumericValue)&&(secondNumericValu e<thirdNumericValue))
    {
    max=firstNumericValue;
    min=secondNumericValue;
    }
    Else if((secondNumericValue>firstNumericValue)&&(second NumericValue>thirdNumericValue)&&(firstNumericValu e>thirdNumericValue))
    {
    max=secondNumericValue;
    min=thirdNumericValue;
    }
    Else if((secondNumericValue>firstNumericValue)&&(second NumericValue>thirdNumericValue)&&(firstNumericValu e<thirdNumericValue))
    {
    max=secondNumericValue;
    min=firstNumericValue;
    }
    Else if((thirdNumericValue>firstNumericValue)&&(thirdNu mericValue>secondNumericValue)&&(firstNumericValue >secondNumericValue))
    {
    max=thirdNumericValue;
    min=secondNumericValue;
    }
    Else if((thirdNumericValue>firstNumericValue)&&(thirdNu mericValue>secondNumericValue)&&(firstNumericValue <secondNumericValue))
    {
    max=thirdNumericValue;
    min=firstNumericValue;
    }
    If(max%min==0){System.out.println(max "divisible by" min);}
    Else {System.out.println("The #s are not divisible by each others.");}
    //this is like C how I can make it in java ?
    }
    }

Check out some similar questions!

Make us one heart make us one mind make us one let your will be done [ 3 Answers ]

Where to find the vido, song or the music score For this song : make us one heart,make us one mind,let your will be done. Make us one flame, to proclaim your name, make us one, make us one

Java [ 3 Answers ]

Please will you help me with these questions... where can I find a great site that will help me answer these... 1/ Who developed Java and when? 2/ What are some unique features of Java? 3/ Is java used for websites or stand alone programs? 4/ What does it mean when I say java is an "object...

Java [ 2 Answers ]

Write a program that converts 10, 50, and 100 kilograms to pounds

About java [ 1 Answers ]

While using a predefined class we should import the packages like import java.io.*,but I have used the predefined class System.out.print without importing any package.. how is it possible.. and how does it works?

Java Help! [ 1 Answers ]

Hi Experts, I'm not sure if I'm posting this in the right category, but I sure hope someone can still help me. I'm not able to view Java applets. I've downloaded the most recent version of JVM. I have version 1.4.1. I've tried changing some settings (like enabling Java in my internet...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.