System.out.println("\nTesting outputAllPatientInfo");
// TODO: after implementing outputAllPatientInfo:
// comment out the next line and remove the comments from the following block of code
//System.out.println("no testing yet.\n");

calc.outputAllPatientInfo();

}{

Can someone give me advise how to be more efficient.

Thanks to anyone who helps.

Daisy

09-27-2005, 03:43 AM

NPH

Most of the code is println statements. Could you paste the rest of the code. That is where the real work is being done I believe. That code is what has to be optimized.

That actually looks fine. If you want to condense the three methods into one, you could add an enumerated constant to your HealthRiskCalculator class that tells what level of risk it is and then inside your consolidated method have a switch statement that performs different operations depending on the health risk level of the HealthRiskCalculator. This would not be as time efficient as having three separate methods, but it would reduce code make it a little more object oriented.