/* Laboratory Assignment For Thursday of Week of 4/10/04 1) Insurance decision When a person applies for insurance policy, company decided whether to insure this person based on following rules (i) no person with income below 100,000 is insured (ii) only persons of age < 50 are insurable if their income is between 100,000 and 200,000. (iii) all persons with income >= 200,000 are insurable Write a method with int "income" as input parameter and it prints the results yes/no, The output type will be void. */ class Calculate { public void generate(double inc, int age) { int x=0; if(inc <= 100000) x = 0; else if(inc< 200000) { if(age < 50) x=1; } else x=1; if(x==0) System.out.println("\n No"); else System.out.println("\n Yes"); return; } } class soln9thur1 { public static void main(String args[]){ MainWindow mainWindow; InputBox inputBox; boolean out ; mainWindow = new MainWindow(); mainWindow.setVisible(true); inputBox = new InputBox(mainWindow); Calculate b = new Calculate(); double income;int age; income = inputBox.getDouble("Please enter the income"); age = inputBox.getInteger("Please enter the age"); b.generate(income,age); } }