Why would purchase be an incompatible type for scan.next()?
(I am trying to get the user input for purchase and tendered, and then use a method to calculate the change).
public static void makeChange() //one method of a class
{
double purchase;
double tendered;
Scanner scan = new Scanner (System.in);
System.out.println ("How much was the Purchase?");
purchase = scan.next(); //why would this be an incompatible type?
System.out.println ("Amount Tendered");
tendered = scan.next();
System.out.println("Processing Transaction");
int ch[] = cd.makeChange(purchase, tendered);
.... continued
Because scanner.next() returns a string as described in the javadoc. That’s the first place to check when a method does not do what you think it should. You probably meant to use
scanner.nextDouble().As pointed out in the comments, if your code is more than an exercise, you should use BigDecimal for monetary amounts to avoid rounding issues (doubles are not exact).