im taking a class and this is the question (((Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds. Output both the mass and the weight rounded to two decimal places. (Note that for standard Earth gravity, 1 kilogram = 2.2 pounds.) Format your output with two decimal places.
this is what i wrote but get like 10 erros can someone hep me out ?
importjava.util.Scanner; // Scanner is in java.util
The first thing you need to do is format this code better. Use proper indentation. Follow coding idioms. For example, the close-paren you have on the line by itself is just wrong. Nobody would ever do that in real production code. also, what is "publicstaticvoidmain"? Is your space key broken, or do you not realize that should be
public static void main
Those are four words that NEED to be separate.
What you really need to do is write less code before you compile. You should have gotten no further than about this far before you compile the first time:
Once you get this much to compile and run, then add the SMALLEST piece you can to it...Maybe add in the import line (and JUST the import line). Make sure that compiles. If not, then you know the problem is on that one line. Yes, you won't see any difference when you run it (assuming it works), but at least you know nothing has gone horribly wrong.
Then once that's all done and working, add another line or two. I guarantee you that no matter how often you recompile and test, you will not be doing it enough.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors