So looking at your post, right away it doesn't seem like you have any kind of understanding of the basic concepts of the language at all.
If your teacher isn't very good and you prefer self-study I'd recommend
Tutorials Point. They have a great introductory Java tutorial.
import java.util.Scanner;
public class Retail {
public static void main(String[] args) {
String amount;
Scanner Keyboard = new Scanner(System.in);
System.out.print("What was the amount of the purchase? ");
amount = Keyboard.nextLine();
//System.out.println("The amount of the purchase was " + amount);
}
}
https://gist.github.com/Isonyx/5158b3a813af1c659cd1
So, problems with the code.
Firstly, you didn't balance the braces for the main function. Every block needs to have an opening and closing brace. With a few exceptions such as if statements, but I won't go into that.
Secondly, you probably should have given the variable amount a type at the beginning of the program execution (main).
Although normally I would recommend giving it the value "double" or "float", we can't really do that here since the method you used to grab input from the user makes sure the user inputs a type of value known as a "string".
So instead we declare the storage container for the value the user wants to put in as a string.
Thirdly, you didn't tell Java what "Keyboard" was.
When you said Keyboard.nextLine you were basically invoking an operation if you will, that is an attribute of the object Keyboard. Because of this Java needs to know what Keyboard is.
Keyboard is going to be an object of the type "Scanner".
"Scanner" is not a "primitive data type" and thus not a core part of the language, therefore we need to import some files that tell us exactly what "Scanner" type object is. That's why I added the "import" section at the beginning of your code.
System.out.println ("What was the amount of the purchase?");
This is unnecessary.
Also, I hope your assignment doesn't require you to do any kind of mathematical operation with that variable amount. Otherwise you'll need to reformat your code.
As for the other pieces of code, seriously, read the tutorial. Or find some other user to do your homework for you.