by @jessele Edwards Fork
{"functions":[],"name":"bookInventoryMenu","main":{"rawId":"main","tpe":"Void","name":"main","statements":[{"@type":"Begin","id":"id_01e79caf_b07a_4176_aa0f_674cbb531635"},{"@type":"Comment","id":"id_8e94b092_d9de_4968_9eec_a55060b84b74","text":"Declare a var to hold a menu choice"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"menuChoice","lengthValue2":"5","id":"id_aa6cbaef_0c0e_44e8_b0d6_acdb5259f5f1","initValue":null},{"condition":"menuChoice != 4","@type":"DoWhile","id":"id_a11a7c00_1f1d_4659_9d85_2bdf1096979d","body":{"statements":[{"@type":"Comment","id":"id_ec8cfe40_667a_40e3_a100_b9bd35262154","text":"diplay the menu options 1. add a book 2. edit a book 3. remove a book 4. exit the application"},{"newline":true,"@type":"Output","id":"id_aef6fbb2_fc44_4315_af9e_7fb2d8c9f72d","value":"\"Choose from one of the following options: \""},{"newline":true,"@type":"Output","id":"id_26e89efa_251f_43e5_8230_1d3260d28a7d","value":"\"1. Add a book \""},{"newline":true,"@type":"Output","id":"id_6c486de1_4404_4dac_8e68_cc71b262ebad","value":"\"2. Edit a book \""},{"newline":true,"@type":"Output","id":"id_a87802d1_6428_454d_a8b0_40eeaf70e7d4","value":"\"3. Remove a book \""},{"newline":true,"@type":"Output","id":"id_d74c8eb1_bb8b_4aab_8cf7_68da64b6373b","value":"\"4. Exit application \""},{"@type":"Comment","id":"id_52b2a751_ebbd_449d_a516_88c03c982a76","text":"ask the user for the input of the menu choice"},{"newline":true,"@type":"Output","id":"id_b23bf1af_cc92_4593_aaa6_20550ed603bc","value":"\"Enter your choice (1, 2, 3, or 4): \""},{"@type":"Input","name":"menuChoice","id":"id_47ba1854_0ea5_48b6_b9fd_b1bc51fc50ba","prompt":null},{"@type":"Comment","id":"id_92d400b7_8342_43e7_9031_6ff0a3b535c3","text":"if the user chooses an invalid choice, \tdisplay an error and reprompt / redisplay the menu and get another choice"},{"condition":"menuChoice < 1 || menuChoice > 4","@type":"While","id":"id_2a97cfa0_fe7b_4924_a5fa_4b335cb9134d","body":{"statements":[{"newline":true,"@type":"Output","id":"id_4a401d11_4f75_4204_b94d_b34a4cd520f9","value":"\"Error: Invalid Menu Choice. Try Again. \""},{"newline":true,"@type":"Output","id":"id_564bbf46_5c6d_4051_bf12_d76a50875e44","value":"\"Choose from one of the following options: \""},{"newline":true,"@type":"Output","id":"id_e5c81539_b1d8_459d_b4d9_d536c7a180df","value":"\"1. Add a book \""},{"newline":true,"@type":"Output","id":"id_483239e4_b435_4556_91c2_c11b4b0f0891","value":"\"2. Edit a book \""},{"newline":true,"@type":"Output","id":"id_208ed371_1384_4078_88fe_75f2a4f5e6a6","value":"\"3. Remove a book \""},{"newline":true,"@type":"Output","id":"id_83d28850_8f64_4847_8c9b_a67bbb248f13","value":"\"4. Exit application \""},{"newline":true,"@type":"Output","id":"id_6bdcd573_840e_4d7b_ac51_7bd943169bd4","value":"\"Enter your choice (1, 2, 3, or 4): \""},{"@type":"Comment","id":"id_73467092_d350_4eee_9f9b_618a8cee70e3","text":"ask the user for the input of the menu choice"},{"@type":"Input","name":"menuChoice","id":"id_12238f61_3597_4c49_ac76_ae028b8fc26c","prompt":null}],"id":"id_53e2e92d_1d1d_4898_adfe_2991f9513425"}},{"falseBlock":{"statements":[{"falseBlock":{"statements":[{"falseBlock":{"statements":[{"@type":"Comment","id":"id_3cacd714_0f76_4929_9aea_66b3f4532180","text":"if the user chooses option 4 \t display 'You chose to exit the application'"},{"newline":true,"@type":"Output","id":"id_e38a6ce6_82a7_4f0c_975d_e07b684f678f","value":"\"You chose to exit the application\""}],"id":"id_9b5b10fb_76e6_4d10_bf28_f7a3cc204043"},"trueBlock":{"statements":[{"@type":"Comment","id":"id_baf1113d_972e_4e9c_b1fe_a0f1f81521f5","text":"if the user chooses option 3 \tdisplay 'You chose to remove a book'"},{"newline":true,"@type":"Output","id":"id_1887c067_ee5d_4fe7_805d_7479a31d81dd","value":"\"You chose to remove a book\""}],"id":"id_8860cc39_45ad_4e15_8c25_074740f4c6ab"},"condition":"menuChoice == 3","@type":"If","id":"id_94f4900d_28a6_4187_a0c1_fe800201952d"}],"id":"id_21d8284f_411d_4b6d_8229_a2da671dfc59"},"trueBlock":{"statements":[{"@type":"Comment","id":"id_7c700726_3e21_47fe_b202_8ffe6a9e9b97","text":"if the user chooses option 2 \tdisplay 'You chose to edit the book'"},{"newline":true,"@type":"Output","id":"id_fb945abd_c21a_49cd_8a82_7fdd31d453d1","value":"\"You chose to edit the book \""}],"id":"id_e379850c_09fc_446f_b351_a48577465fbb"},"condition":"menuChoice == 2","@type":"If","id":"id_4424b7e3_e8cd_498e_b2bf_39cfb5977ca3"}],"id":"id_e7190add_8a7d_4d47_ac1e_c2ebacf004a9"},"trueBlock":{"statements":[{"@type":"Comment","id":"id_1c2709ca_4471_48cb_ba76_607b7cd4e347","text":"if the user chooses option 1 \tdisplay 'You chose to add a book'"},{"newline":true,"@type":"Output","id":"id_bfeec945_7efd_4327_95bf_0cae4e82a8bc","value":"\"You chose to add a book \""}],"id":"id_8692611d_0087_4d95_aff2_ed3d137119a9"},"condition":"menuChoice == 1","@type":"If","id":"id_8e73d2fb_84b3_458f_8d39_0e5beae4cd4f"}],"id":"id_be768101_6d1e_44ca_8a7c_3014a9b26c09"}},{"@type":"Return","id":"id_36f615b3_f897_4442_a1f2_4acfb6444510","maybeValue":null}],"parameters":[]},"id":"id_f5696083_c35a_4a9d_a2a6_93a86f6bf613","config":{"showDebugVars":true,"useInputPrompt":false,"echoEnteredValue":false,"showIoBtns":true,"showFunctions":false,"lang":"java","showGenCode":false},"version":"0.3","revision":467}