This is a calculator for F = MA. (Force = Mass * Acceleration) I would like a review of my code. I believe that I have gotten better since my last time.package ufvnik;import java.util.Scanner;/** @author: Sean*/public class tfci {private static Scanner keyboard;public static void main(String args[]){    //calls the equals class method. (this is the organizational part I'm so proud of haha)    //this statement passes the arguments 0,0 into the method.    //but they are zero until the user inputs a value for each; Acceleration, and Mass.    equals(0,0);}//this is the method header, contains the parameter variables for equals.public static void equals(float Mass, float Accel){    //float force holds the calculations, until 'force' is called.     float Theforce;    //lets user know what this program actually is and does.    System.out.println(this is a F = M * A calculator.\n);    keyboard = new Scanner(System.in);    //prompt the user to input data.     System.out.println(how much does it weigh in Kg?: );    //holds the Input    Mass = keyboard.nextFloat();    //prompt the user again to input data.    System.out.println(what is the acceleration in m/s?:  );    Accel = keyboard.nextFloat();    //calculate the 'force'    Theforce = Mass * Accel;    //end of program-     System.out.println(the Force is:  +  Theforce);    }}
F = MA calculator
java;calculator
I have not compiled or executed it, but it is very simple and there are no glaring errors that would have it not work.That said as a programmer there is no end of bad in that code.Naming conventionsClass names start with uppercaseVariables start with lowercaseNames should brief and have contextual meaning To experienced programmers breaking these simple style rules is frustrating and the very first thing they do when given such badly styled code is fix it, because it hurts to read it.The function equals ?? surly a more descriptive name? calculateForce would have been much better and at least have some relationship to what it is doing.TheForce LOL lowercase theForce no still wrong, the the is superfluous, just force will do fine.CommentsWhen you write comments you are not writing a how to program manual for non programmers. Comments should be minimal, unobtrusive, and only be added if the code needs extra explanation. Comments should improve the readability of code not the reverse. Your commenting has made the whole thing very unreadable.For example you have://this is the method header, contains the parameter variables for equals.public static void equals(float Mass, float Accel){    //float force holds the calculations, until 'force' is called.     float Theforce;Not only pointless but incorrect. It's not a method header it is a method declaration, and parameters variables for equals is just stating what is obvious. Yet I am left hanging... The only comments I was looking for was why pass Mass, Accel to the method in the first place?User interface.Even if it is a simple program impressions count. Bad presentation can break a product, confusing or obscure front ends are a guaranteed death for the product.    //lets user know what this program actually is and does.    System.out.println(this is a F = M * A calculator.\n);lets user know... Does it? Maybe in context but I am left feeling that some text is missing due to the lower case t leading into the vague description. I will wait a see what happens before making conclusions as to what it does. BTW Mass is lower case m and same for acceleration a. Even F=ma calculator. would have made more sense.GeneralThe two arguments being passed to the input function makes no sense at all, nor is there any comment as to why you did this.Unless you have good reason use private methods rather than public.Use blank lines to separate connected code and make it easier to read.Code should never be more complex than required. Evaluating an expression and storing the result that is then only used once is unnecessary. In your example force (AKA TheForce) is not needed.Class names need to have meaning to all that are expected to read it.This code does not require any comment. Java is expressive enough for all that is needed to know can be put into the code.A rewritepackage ufvnik;import java.util.Scanner;public class CodeReview {    public static void main(String args[]){        Scanner inScan = new Scanner(System.in);        float acceleration;        float mass;        System.out.println(Welcome to the force calculator.\n);        System.out.println(Enter a mass in kg? : );        mass = inScan.nextFloat();        System.out.println(Enter acceleration in meters per second squared? :  );        acceleration = inScan.nextFloat();        System.out.println(Force is equal to :  + (mass * acceleration) + Newtons\n);        inScan.close();    }}