This is really simple but I don't want to spoon feed the solution. I'll give you hints and questions instead.
1. Do you know how to print a string to the terminal?
2. Do you know how to create a variable?
3. Do you know basic arithmetic? What's 1 + 1? What about 500 * 80%?
4. Do you know how to compute the discount using pen and paper only?
5. Do you know how to create a simple Class in Java? A simple static method?
6. Do you understand in your own words what the business problem is? This is English comprehension.
If the answer is no to any of these, go learn those first before tackling this programming problem.
If the answer is yes to all of these, here's what you should do. Divide and conquer the problem into smaller functions, simple classes or static methids. Whichever is easier for you.
- Create a function that only does the discount computation.
- Create a function that just accepts the input
- Create a function that validates input
- Create a function that prints the output.
Yes you can write these as one giant function but this is often what leads to confusion among beginners. They write poorly organized code which leads to bugs and harder to understand codes.