class Math

Ads

 
 

Share on Google+Share on Google+

sassy
class Math
1 Answer(s)      9 years ago
Posted in : Java Beginners
Ads
View Answers

September 25, 2008 at 10:49 AM


Hello Friend

use this code, might be helpful to you.

public class MathFunction {

public static void main(String s[]) throws IOException{
InputStreamReader ins = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(ins);
String input;
float num= 0;
do{
System.out.println("Enter a Float number");
num = Float.parseFloat(br.readLine());
System.out.println("The Smallest Whole Number greater than " +num + " is " + Math.ceil(num));
System.out.println("The Largest Whole Number smaller than " +num + " is " + Math.floor(num));
System.out.println("The Absolute Number of " + num + " is " + Math.abs(num));
System.out.print("Do U want more (y/n)");
input = br.readLine();
}while(!input.equalsIgnoreCase("n"));
System.out.println("Exit");
}
}


Rajaniaknt

Ads









Related Tutorials/Questions & Answers:
Java math class
Java math class  Can you instantiate the Math class
java Math class
java Math class  Why are the methods of the Math class static
Advertisements
Java math class
Java math class  Why can?t I say just abs() or sin() instead of Math.abs() and Math.sin
class Math - Java Beginners
class Math  "Helo man&sir can you share or gave me a java code hope its ok?" Complete a program that asks the user a floating-point number (either... to you. public class MathFunction { public static void main(String s
Can you instantiate the Math class? - Java Beginners
Can you instantiate the Math class?   Hi, Can you create object of Math class? Thanks   Hi, All the methods in Math class is static. The constructor is not public in the Math class. So, we can't create
Java - Math class in Java
Java - Math class in Java       In this example you will learn about Math class. This example explains how you can use functions provided by the Math class like E, PI, round, abs
Introduction To Math Class In Java
Introduction To Math Class In Java In this tutorial we will read about.... Math class is created inside the java.lang package and the classes created inside... the application. Class Declaration public final class Math extends Object Constant
Version of commons-math>commons-math dependency
List of Version of commons-math>commons-math dependency
Version of com.techshroom>Math dependency
List of Version of com.techshroom>Math dependency
Math Program - Java Beginners
Math Program  The greatest common divisor of two integers 16 and 24 is 8. Develop the algorithm for finding the greatest common divisor of two...: import java.util.*; class GCD{ public static int determineGCD(int
Artifacts of commons-math
List of Artifacts of commons-math maven depenency
Math Constants and Functions using JavaScript
Math Constants and Functions using JavaScript  What's Math Constants and Functions using JavaScript
Maven Dependency commons-math >> 1.1
You should include the dependency code given in this page to add Maven Dependency of commons-math >> commons-math version1.1 in your project
Maven Dependency commons-math >> 20040118.003354
You should include the dependency code given in this page to add Maven Dependency of commons-math >> commons-math version20040118.003354 in your project
Maven Dependency commons-math >> 20040218.045431
You should include the dependency code given in this page to add Maven Dependency of commons-math >> commons-math version20040218.045431 in your project
Maven Dependency commons-math >> 1.0
You should include the dependency code given in this page to add Maven Dependency of commons-math >> commons-math version1.0 in your project
Maven Dependency commons-math >> 20040118.003950
You should include the dependency code given in this page to add Maven Dependency of commons-math >> commons-math version20040118.003950 in your project
Version of com.accelad>nilgiri-math dependency
List of Version of com.accelad>nilgiri-math dependency
Version of com.cjmalloy>gwt-math dependency
List of Version of com.cjmalloy>gwt-math dependency
Version of com.enterprisemath>em-math dependency
List of Version of com.enterprisemath>em-math dependency
Version of com.flowpowered>flow-math dependency
List of Version of com.flowpowered>flow-math dependency
which part of the cpu does math calculations
which part of the cpu does math calculations  which part of the cpu does math calculations logical calculation
Evaluating a math expression given in string form
Evaluating a math expression given in string form  Evaluating a math expression given in string form
class
class  Is a class a subclass of itself
Maven Dependency Math >> 1.0.0
You should include the dependency code given in this page to add Maven Dependency of com.techshroom >> Math version1.0.0 in your project
Version of com.accelad>nilgiri-math-evaluator dependency
List of Version of com.accelad>nilgiri-math-evaluator dependency
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
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
Maven Dependency nilgiri-math >> 1.11
You should include the dependency code given in this page to add Maven Dependency of com.accelad >> nilgiri-math version1.11 in your project
Maven Dependency nilgiri-math >> 1.12
You should include the dependency code given in this page to add Maven Dependency of com.accelad >> nilgiri-math version1.12 in your project
Maven Dependency nilgiri-math >> 1.14
You should include the dependency code given in this page to add Maven Dependency of com.accelad >> nilgiri-math version1.14 in your project

Ads

 
Advertisement null

Ads