^
in java does not mean to raise to a power. It means XOR.
You can use java’s Math.pow()
And you might want to consider using double
instead of int
—that is:
double height;
double weight;
Note that 199/100
evaluates to 1.
More Related Contents:
- Double vs. BigDecimal?
- How can I hash a password in Java?
- NoClassDefFoundError – Eclipse and Android
- wait until all threads finish their work in java
- How do I check if a date is within a certain range?
- Why does InetAddress.isReachable return false, when I can ping the IP address?
- How to parse JSON in Java
- How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
- What does “Could not find or load main class” mean?
- How do I keep a Scanner from throwing exceptions when the wrong type is entered?
- When should we create our own Java exception classes? [closed]
- Streaming large result sets with MySQL
- StringBuilder/StringBuffer vs. “+” Operator
- Copying text to the clipboard using Java
- Java: If vs. Switch
- How to get String from Mono in reactive java
- Regex reuse a pattern to capture multiple groups?
- Byte Stream and Character stream
- Difference Between Object Type and Reference Type
- Properly closing SSLSocket
- How to get unique items from an array?
- Why does a Java if statement fail when it ends in semicolon [duplicate]
- Access subclass fields from a base class in Java
- when is static variable loaded in java, runtime or compile time?
- Scaling/Translating a Shape to a given Rectangle using AffineTransform
- How can I reference my Java Enum without specifying its type
- Try-catch-finally and then again a try catch
- Spring Boot – Reading Text File using ResourceLoader
- Extract Image from PDF using Java
- Lightweight servlet engine for serving java application via IIS