Indenting is the first part of common practice that you should consider when sharing your code with anyone. Here is your code, which I have put though the 'standard' indenting function of Eclipse:
import java.util.Scanner;
public class LMComplex {
Scanner name = new Scanner(System.in);
Scanner age = new Scanner(System.in);
Scanner gender = new Scanner(System.in);
Scanner height = new Scanner(System.in);
String usrname;
String usrage;
String usrgender;
Double usrheight;
public void main() {
System.out.println("Enter your name: ");
usrname = name.nextLine();
System.out.println("Enter your age(Numbers): ");
usrage = age.nextLine();
System.out.println("Enter your gender(male/female): ");
usrgender = gender.nextLine();
System.out.println("Enter your height(feet.inches . 5 feet 5 inches = 5.5): ");
usrheight = height.nextDouble();
Double rusrheight = Math.ceil(usrheight);
if (rusrheight > usrheight)
{
rusrheight = rusrheight - 1;
}
else
{
}
Double rusrheightininches = usrheight - rusrheight;
if (rusrheightininches >= 0.10 && rusrheightininches < 0.12)
{
rusrheightininches = rusrheightininches * 100;
} else {
rusrheightininches = rusrheightininches * 10;
}
Double rusrheightinincheschecker = rusrheightininches;
rusrheightininches = Math.ceil(rusrheightininches);
if (rusrheightininches > rusrheightinincheschecker)
{
rusrheightininches = rusrheightininches - 1;
}
else
{
}
System.out.println("Hii " + usrname + ". I am Cartic, a basic textual virtual personal assistant. I do know that you are " + usrage
+ " years old. You are a " + usrgender + " and are " + rusrheight + " feet " + rusrheightininches + " inch(es) tall");
}
}
Now, it is much easier to see the structure.
Java code-style guidelines put the {
opening brace on the same line as the control statement, so, for example, the code:
if (rusrheightininches >= 0.10 && rusrheightininches < 0.12)
{
rusrheightininches = rusrheightininches * 100;
} else {
rusrheightininches = rusrheightininches * 10;
}
should be:
if (rusrheightininches >= 0.10 && rusrheightininches < 0.12) {
rusrheightininches = rusrheightininches * 100;
} else {
rusrheightininches = rusrheightininches * 10;
}
Also, in the previous if
statement you have an empty else block.... you can just remove it:
if (rusrheight > usrheight)
{
rusrheight = rusrheight - 1;
}
else
{
}
becomes:
if (rusrheight > usrheight) {
rusrheight = rusrheight - 1;
}
As for your variables, they are nice descriptive names, but, in Java, it is common to use what is called 'camelCase', where the first letter is lower-case, and the subsequent first-word-letters are Capitalized.
Also, while it is often convenient to shorten long parts of variables, the abbreviation of 'user' to 'usr' is not saving you much.....
So, for example, your variables :
String usrname;
String usrage;
String usrgender;
Double usrheight;
would be
String userName;
String userAge;
String userGender;
Double userHeight;
I would recommend that you use an IDE (Eclipse/IntelliJ/Netbeans) to help you get these things right. There is some debate about whether new programmers should use an IDE or not, because they make some things really easy and you may miss understanding some of the basic requirements of the language.... but, I believe that the IDE's allow you to focus on the stuff that is more important, like the code content.