import java.util.Scanner; public class SetUpSite2 { public static void main(String[] args) { final int FOUNDED_YEAR = 1977; int currentYear; int age; Scanner input = new Scanner(System.in); statementOfPhilosophy(); System.out.print("Enter the current year as a four digit number"); currentYear = input.nextInt(); age = calculateAge(FOUNDED_YEAR, currentYear); // problem here System.out.println("Founded in " + FOUNDED_YEAR); System.out.println("Serving your for " + age + "years!"); } public static void statementOfPhilosophy() { System.out.println("Event Handlers Incorporated is"); System.out.println("dedicated to making your event"); System.out.println("a most memorable one."); } public static void calculateAge(int originYear, int currDate) { int years; years = currDate - originYear; return years; } }
I am not sure what is wrong with line 17, it says "incompatible data types" when everything I am using is 'int'
I am also having trouble with my return line saying my return type is void.
I appreciate the help, I am new to this site as well. Looking forward to being active here for my homework help and future projects to come.