by @Carl Air Fork
{"functions":[],"name":"mod1CourseProject","main":{"rawId":"main","tpe":"Void","name":"main","statements":[{"@type":"Begin","id":"id_19e9def5_1fa4_4259_861d_b221fb3134d9"},{"@type":"Comment","id":"id_f74c5496_345d_49d7_8f2f_497b185dbdfb","text":"Declare a variable to hold a menu choice"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"menuChoice","lengthValue2":"5","id":"id_dc0ab155_8f37_434d_bdca_0cee309714fc","initValue":null},{"condition":"menuChoice != 4","@type":"DoWhile","id":"id_2061311f_b1bc_4f6c_a5b4_f2d5e4c54e36","body":{"statements":[{"@type":"Comment","id":"id_bba4e0a2_28c1_4fe9_bc32_b34ed0e0aba1","text":"Display 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_dbf2405a_5061_4870_a7c7_f537ab16575b","value":"\"Choose from one of the following options: \""},{"newline":true,"@type":"Output","id":"id_4508f90b_7de0_41c7_9b6a_8966d2895126","value":"\"1. Add a book\""},{"newline":true,"@type":"Output","id":"id_a5898d58_3f46_455b_a6c3_ec1ce7fdd2c8","value":"\"2. Edit a book\""},{"newline":true,"@type":"Output","id":"id_c7466045_9d0c_45aa_85cb_a00ddd625eca","value":"\"3. Remove a book\""},{"newline":true,"@type":"Output","id":"id_1c999b9b_6ecc_4325_a54d_02e4388df3f6","value":"\"4. Exit the application\""},{"@type":"Comment","id":"id_d75f21b1_b05a_4866_bac9_5964e87e50d7","text":"ask the user for the input of the menu choice"},{"newline":true,"@type":"Output","id":"id_5e307521_9520_4c23_b7c6_a9825fb19b9d","value":"\"Enter your choice (1, 2, 3, or 4): \""},{"@type":"Input","name":"menuChoice","id":"id_a5c156a1_9370_455c_801c_07e292812b90","prompt":null},{"@type":"Comment","id":"id_94371713_fd0c_4e8b_a6c4_ac4ed4f2f45e","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_0ee7f3b2_35ea_462f_b339_0e62ad30a626","body":{"statements":[{"newline":true,"@type":"Output","id":"id_439fc375_2c0e_4d7d_abf5_1fcc08eb5752","value":"\"ERROR: Invalid Menu Choice. Try Again. \""},{"newline":true,"@type":"Output","id":"id_3159245c_887a_4f88_8c8c_9e66a0441cad","value":"\"Choose from one of the following options: \""},{"newline":true,"@type":"Output","id":"id_d930c805_336c_4477_a3ea_b0bbbc08f23e","value":"\"1. Add a book\""},{"newline":true,"@type":"Output","id":"id_2dea52e4_2bb1_48ce_b7f0_d7f4af11c0f6","value":"\"2. Edit a book\""},{"newline":true,"@type":"Output","id":"id_e89a8e8d_eae8_4983_99c2_da061b37f9fc","value":"\"3. Remove a book\""},{"newline":true,"@type":"Output","id":"id_37a213db_0e90_40f9_a85a_69503ad25bca","value":"\"4. Exit the application\""},{"newline":true,"@type":"Output","id":"id_10d0a3d4_63b1_48b5_bc8f_0dc663f741a1","value":"\"Enter your choice (1, 2, 3, or 4): \""},{"@type":"Input","name":"menuChoice","id":"id_5dc9c697_cb90_4046_92a3_8a228ab998d7","prompt":null}],"id":"id_c98354bf_3fd4_4083_abc4_6b0e3c0f0d5a"}},{"falseBlock":{"statements":[{"falseBlock":{"statements":[{"falseBlock":{"statements":[{"@type":"Comment","id":"id_4e57bd24_ad9b_4025_b4bc_8e07cb1c1165","text":"if the user chooses option 4"},{"newline":true,"@type":"Output","id":"id_c61cd825_e3fc_4bfd_b406_282c829acc97","value":"\"You chose to exit the application. Thank you!\""}],"id":"id_20755225_0b03_4d17_8204_cc5f5db646e0"},"trueBlock":{"statements":[{"@type":"Comment","id":"id_b0d0cb96_624f_4331_8935_44140020e236","text":"if the user chooses option 3"},{"newline":true,"@type":"Output","id":"id_aeedeafb_fb00_41a1_bb2b_c9c24e0bf906","value":"\"You chose to remove a book.\""}],"id":"id_7a54082d_e6b7_428a_b79e_9324dce0a234"},"condition":"menuChoice == 3","@type":"If","id":"id_1848236d_a5bd_43d3_a773_ee85df1f6df1"}],"id":"id_1ad67d49_7d58_4611_b8cb_44457d4813fb"},"trueBlock":{"statements":[{"@type":"Comment","id":"id_a6548deb_f076_4a59_ac1d_78dc16cfb007","text":"if the user chooses option 2"},{"newline":true,"@type":"Output","id":"id_9d077d0c_c9fe_4dbe_8dbf_cc846aec43c2","value":"\"You chose to edit a book.\""}],"id":"id_86cea246_2b6c_4dd0_94ad_89cb115c7ceb"},"condition":"menuChoice == 2","@type":"If","id":"id_e90425af_4840_4650_83da_93f0f68ab63a"}],"id":"id_0fd9b22a_74a0_4a04_b77e_30ea1134e5df"},"trueBlock":{"statements":[{"@type":"Comment","id":"id_078d0e74_8c0f_4126_bdef_f14db0964d3d","text":"if the user chooses option 1"},{"newline":true,"@type":"Output","id":"id_1996761f_08c5_4987_9f3c_ce4d3c1a13ce","value":"\"You chose to add a book.\""}],"id":"id_08fb5b8e_5f91_4827_ab68_05891622ed17"},"condition":"menuChoice == 1","@type":"If","id":"id_0fb0ab82_5906_4b6b_8c94_6a7b11844711"}],"id":"id_0f4623a3_a93a_4454_81be_da1994f90afa"}},{"@type":"Return","id":"id_4406b70c_1df5_49c8_9d72_4676c06c86cb","maybeValue":null}],"parameters":[]},"id":"id_8074fbc4_162c_4123_8f97_abd328a0837b","config":{"showDebugVars":true,"useInputPrompt":false,"echoEnteredValue":false,"showIoBtns":true,"showFunctions":false,"lang":"java","showGenCode":false},"version":"0.3","revision":323}