Answer:
import java.util.Scanner;
public class candy {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("Type in number of children: ");
//gets the number of children
int numberOfChildren = Integer.parseInt(sc.nextLine());
System.out.println("Type in number of candy: ");
//gets number of candy
int numberOfCandy = Integer.parseInt(sc.nextLine());
//checks there will be any leftover candy
int leftover = numberOfCandy%numberOfChildren;
System.out.println("Each children will get "+(numberOfCandy-leftover)/numberOfChildren+" candies.");
System.out.println("There will be "+leftover+" leftover candies.");
}
}