core: import java.lang.*; import java.io.*; import edu.neu.ccs.demeter.dj.*; import java.util.*; import edu.neu.ccs.demeter.*; add: class Amount { protected int amount; public int get_amount() {{ return amount; }} public void set_amount(int new_amount) {{ amount = new_amount; }} public constructor Amount() {{ super(); }} public constructor Amount(int amount) {{ super(); set_amount(amount); }} public static Amount parse(java.io.Reader in) throws ParseException {{ return new Parser(in)._Amount(); }} public static Amount parse(java.io.InputStream in) throws ParseException {{ return new Parser(in)._Amount(); }} public static Amount parse(String s) {{ try { return parse(new java.io.StringReader(s)); } catch (ParseException e) { throw new RuntimeException(e.toString()); } }} public static Amount prompt(String prompt) {{ /* This function will find an amount given by the user input : prompt - string used to prompt the user output: a new amount with value given by the user */ int amount = Main.promptInt(prompt); Amount returnAmount = new Amount(amount); return returnAmount; }} {{ void universal_trv0_bef(UniversalVisitor _v_) { ((UniversalVisitor) _v_).before(this); } }} {{ void universal_trv0_aft(UniversalVisitor _v_) { ((UniversalVisitor) _v_).after(this); } }} {{ void universal_trv0(UniversalVisitor _v_) { universal_trv0_bef(_v_); ((UniversalVisitor) _v_).before_amount(this, amount); ((UniversalVisitor) _v_).after_amount(this, amount); universal_trv0_aft(_v_); } }} {{ void everything_Bank_trv_bef(PrintVisitor __v0) { ((UniversalVisitor) __v0).before(this); } }} {{ void everything_Bank_trv_aft(PrintVisitor __v0) { ((UniversalVisitor) __v0).after(this); } }} {{ void everything_Bank_trv(PrintVisitor __v0) { everything_Bank_trv_bef(__v0); ((PrintVisitor) __v0).before_amount(this, amount); ((UniversalVisitor) __v0).after_amount(this, amount); everything_Bank_trv_aft(__v0); } }} {{ void __trav_print_Bank_trv_bef(PrintVisitor __v0) { ((UniversalVisitor) __v0).before(this); } }} {{ void __trav_print_Bank_trv_aft(PrintVisitor __v0) { ((UniversalVisitor) __v0).after(this); } }} {{ void __trav_print_Bank_trv(PrintVisitor __v0) { __trav_print_Bank_trv_bef(__v0); ((PrintVisitor) __v0).before_amount(this, amount); ((UniversalVisitor) __v0).after_amount(this, amount); __trav_print_Bank_trv_aft(__v0); } }} {{ void __trav_display_Bank_trv_bef(DisplayVisitor __v0) { ((DisplayVisitor) __v0).before(this); } }} {{ void __trav_display_Bank_trv_aft(DisplayVisitor __v0) { ((DisplayVisitor) __v0).after(this); } }} {{ void __trav_display_Bank_trv(DisplayVisitor __v0) { __trav_display_Bank_trv_bef(__v0); ((DisplayVisitor) __v0).before_amount(this, amount); ((UniversalVisitor) __v0).after_amount(this, amount); __trav_display_Bank_trv_aft(__v0); } }} {{ void __trav_viewPosting_Posting_trv_bef(PrintVisitor __v0) { ((UniversalVisitor) __v0).before(this); } }} {{ void __trav_viewPosting_Posting_trv_aft(PrintVisitor __v0) { ((UniversalVisitor) __v0).after(this); } }} {{ void __trav_viewPosting_Posting_trv(PrintVisitor __v0) { __trav_viewPosting_Posting_trv_bef(__v0); ((PrintVisitor) __v0).before_amount(this, amount); ((UniversalVisitor) __v0).after_amount(this, amount); __trav_viewPosting_Posting_trv_aft(__v0); } }} }