2 Answer(s)      6 years and 8 months ago
Posted in : JavaScript Questions

import java.util.*; public class method { static Scanner console = new Scanner (System.in);

```public static void main (String[] args)
{
int num1,num2,maximum,minimum;
double average;

System.out.print ("Enter two numbers : ");
num1=console.nextInt();
num2=console.nextInt();

maximum = myMax (num1,num2);
minimum = myMin (num1,num2);
average = myAvg (num1,num2);
System.out.println ("The large number is "+maximum);
System.out.println ("The small number is "+minimum);
System.out.println ("The average of the numbers is "+average);
```

}

```public static int myMax (int x,int y)
{
int maximum;

if (x >= y)
maximum = x;
else
maximum = y;

return maximum;
}

public static int myMin  (int x,int y)
{
int minimum;

if (x <=y)
minimum = x;
else
minimum = y;

return minimum;
}

public static double myAvg (int x,int y)
{
double average;
double sum;

sum = x+y;
average = sum / 2;

return average;
}
```

}

January 21, 2011 at 10:53 AM

Hi Friend,

Here is the required code:

```import java.io.*;
public class method {
public static void main (String[] args)throws Exception
{
int num1,num2,maximum,minimum;
double average;

System.out.print ("Enter First number: ");
System.out.print ("Enter second number: ");

maximum = myMax (num1,num2);
minimum = myMin (num1,num2);
average = myAvg (num1,num2);
System.out.println ("The large number is "+maximum);
System.out.println ("The small number is "+minimum);
System.out.println ("The average of the numbers is "+average);

}

public static int myMax (int x,int y)
{
int maximum;

if (x >= y)
maximum = x;
else
maximum = y;

return maximum;
}

public static int myMin  (int x,int y)
{
int minimum;

if (x <=y)
minimum = x;
else
minimum = y;

return minimum;
}

public static double myAvg (int x,int y)
{
double average;
double sum;

sum = x+y;
average = sum / 2;

return average;
}
}
```

Thanks

January 23, 2011 at 11:27 AM

hi friend!! wahh.. a bit same but more complicated.. anyway,, thanks a lot yah!! :)

convert it to BufferedReader class  import java.util.*; public class... is the required code: import java.io.*; public class method { public static void main...; double average; BufferedReader br=new BufferedReader(new InputStreamReader
Convert InputStream to BufferedReader   ... a input stream. java.io. BufferedReader class provides efficient way...) class. This data is in the form of bytes. To convert the byte form
BufferedReader  What is BufferedReader used for?   BufferedReader read text from a character-input stream, buffering characters so... data from the file and console. Here is an example: import java.io.*; class
Java IO BufferedReader In this section we will discuss about the BufferedReader class in Java. BufferedReader class in java.io package is used for read... be specified. In most of the purposes default size of buffer is used. BufferedReader
Convert String to Class - JSP-Servlet
Convert String to Class  Hi all, I am using Quartz as a scheduler.... Reading job name, class name, day & time using xml file only. Problem is while reading class name, retrieve as a string format but Quartz required in "Class" format
What is the use of BufferedReader in Java program?
Learn about BufferedReader class and understand "What is the use... of BufferedReader class in Java. In Java there are classes for reading... the charset to decode the byte into characters. The BufferedReader class provides
Convert Class File to .java File - Java Beginners
Convert Class File to .java File  Sir, How To Convert .class file to .java File. Please Help me  Use cavaj software ,which is freeware, to convert .class to .java  Use jd-gui to convert ur .class to .java
How to convert many class files into one exe file?
How to convert many class files into one exe file?  How to convert class files into one exe file? I have done my project in java.i want to know how to convert it into .exe file? plz reply fast. Thnx in Advance. Happy Pongal
How to convert many class files into one exe file?
How to convert many class files into one exe file?  How to convert class files into one exe file? I have done my project in java.i want to know how to convert it into .exe file? plz reply fast. Thnx in Advance. Happy Pongal
how to convert jsp page to class file - JSP-Servlet
how to convert jsp page to class file  hai. iam doing online banking project by using jsp.i completed all the jsp pages.next can you tell me how to convert these jsp pages to class files with example and where to copy these class
Why bufferedreader is used in java?
of BufferedReader class in Java? why bufferedreader is used in java? It will be great if anyone can give me the example code of BufferedReader class in java. Thanks   Hello, The BufferedReader class is present in the java.io package
Cannot convert 1/23/13 1:18 PM of type class java.util.Date to class java.sql.Timestamp
Cannot convert 1/23/13 1:18 PM of type class java.util.Date to class java.sql.Timestamp  I keep receiving this error every time i select date through jsf calendar, I declared my variable as Timestamp not date. my db is postgresQl
should use the BufferedReader class. Check the details at What is the fastest... text files also which is around 7 to 10 GB. So, which class is to be used to read
. BufferedReader class in Java is also used to read the data in buffer. Here we will show how to read line by line data from a file using BufferedReader...BufferedReader in Java BufferedReader in Java is used to to read characters
what is the default buffer size for bufferedreader
of the BufferedReader class is 8192 chars, which is sufficient for general programming. Developers around the world is using java.io.BufferedReader class to create... is the default buffer size for bufferedreader? Is there any example of reading the big
How To Read File In Java with BufferedReader class - example code This tutorial shows you how you can read file using BufferedReader class in your program. This tutorial is using the BufferedReader class for reading simple text file
. Thanks   Hi, You are right you can use the BufferedReader class... class. The BufferedReader is present in java.io package. You can import...How to Read a file line by line using BufferedReader?  Hello Java
Java convert string to InputStream
used the BufferedReader class to read and display the converted InputStream. Here...Java convert string to InputStream In this section, you will learn how to convert string to Inputstream. In one of the previous sections, we have discussed
class
class  Is a class a subclass of itself
Java Convert Octal to Binary
Java Convert Octal to Binary In this tutorial, you will learn how to convert... of different numbers. You can convert and decimal to octal, decimal to binary... number to binary. Example: import java.io.*; class ConvertOctalToBinary
Read/Convert an inputStream to a String
Read/Convert an inputStream to a String  Hi, I have an input stream in Java and convert it to a String. what is the best code for for this? How to Read/Convert an inputStream to a String? My object is of java.io.InputStream
class
is a class to represent a country in medal tally. It has an attribute of country... medals. In this class, you should also define constructors, and assessor, mutator methods. Task 2 MedalTally.java is a class to model a medal tally, containing
convert to decimal
convert to decimal  f42a4 convert to decimal by using java
Class
Class, Object and Methods       Class : Whatever we can see in this world all the things... is termed as a class. All the objects are direct interacted with its class
class file
class file  how to convert java classfile into java sourcefile
Convert Text File to PDF file
Convert Text File to PDF file  Here is the way how to covert your Text file to PDF File, public class TextFileToPDF { private static void doReadWriteTextFile() { try { BufferedReader inputStream = new