The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Help with Stock Profit Program

Hey anyone could help me I would be greatly appreciative. I am writing a program that asks me to write a method that accepts arguments the number of shares, the purchase price per share, the purchase commission paid, the sale price per share, and the sales commission paid. The method should return the profit or loss from the sale of stock. Demonstrate the method in a program that asks the user to enter the necessary data and displays the amount of the profit or loss. Here is what I have but it keeps saying I have an "else" without an "if" but I do have an "if". HELP lol
import java.util.Scanner;