I have altered my code. Please let me know if I am any closer. I can't get variables to pass from checkModel and checkYear to printResults. This is what the code is supposed to do:
The Insurance module calls the checkModel module which prompts the user for a car model and returns a code that indicates whether the car is insurable. If the model is insurable, the Insurance module then calls the checkYear module, which prompts for a year manufactured and returns a code that indicates whether the car is insurable. The Print Results module tells the user whether the car can be insured.
import java.io.*; public class Insure { // declare global scope variables private BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); private String inputString; public Insure()throws IOException{ //I-O-P initialize(); insureProcess(); cleanUp(); } public void initialize() { System.out.println("Enter car information to see if it is insurable:"); System.out.println(); }// end initialize public void insureProcess() throws IOException { // declare local variable for car choice String car; boolean insurable; int year; // Check Model for insurability System.out.println("Enter a car model: "); inputString = input.readLine(); car = inputString; // Check Year for insurability System.out.println("Enter a year: "); inputString = input.readLine(); year = Integer.parseInt(inputString); // Print Results }// end insureProcess public boolean checkModel(String car, boolean insurable) { if (car.equals("Ford") || car.equals("Chevy") || car.equals("Toyota")) insurable = true; else insurable = false; return insurable; }//end checkModel public boolean checkYear(int year, boolean insurable) { if(year >= 1990) insurable = true; else insurable = false; return insurable; }// end checkYear public void printResults(boolean checkModel, boolean checkYear, boolean insurable) { if(checkModel == true && checkYear == true) System.out.println("Insurable"); else System.out.println("Not insurable"); }// end printResults public void cleanUp() { System.out.println(); }// end cleanup public static void main(String [] args) throws IOException // main method { new Insure(); } // end the main method } // end the program