by @Jose Fork
{"functions":[],"name":"Restaurant Bill - Assignment","main":{"rawId":"main","tpe":"Void","name":"main","statements":[{"@type":"Begin","id":"id_b4bd395e_08ce_4cf5_98a3_abdc608a6983"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Real","name":"percentTip","lengthValue2":"5","id":"id_2eac5806_731e_4b28_842c_987161191492","initValue":"0.15"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Real","name":"percentSalesTax","lengthValue2":"5","id":"id_c919ea4a_9720_4aca_af4f_620cc1c6d7de","initValue":"0.07"},{"@type":"Comment","id":"id_e49ae292_a3a2_4806_976d_a7f79b6ac1df","text":"Both these variables represent a set percentage, so it’s best I declare their values from the start"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Real","name":"mealPurchased","lengthValue2":"5","id":"id_2c9e4689_aeac_4fea_bc76_e52bbf1562fa","initValue":null},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Real","name":"totalAmount","lengthValue2":"5","id":"id_f159acdc_76b8_4946_b0c1_18d0bbd8a821","initValue":null},{"@type":"Input","name":"mealPurchased","id":"id_78d56f08_ca54_45df_bae0_244ed074747c","prompt":null},{"newline":false,"@type":"Output","id":"id_ed563b45_8124_4060_9344_56b63637ea58","value":"\"Purchased Meal: $\""},{"newline":true,"@type":"Output","id":"id_72f6040d_12fc_43e0_8060_d5bc72a8f9c1","value":"mealPurchased"},{"@type":"Assign","name":"percentTip","id":"id_00880bbf_382b_4ed7_ba5f_b7885b35a8ca","value":"(percentTip * mealPurchased) + percentTip"},{"@type":"Comment","id":"id_6840356f_8abd_463c_a24c_8df36394ed63","text":"Instead of declaring a new variable, it’s more efficient if I assign percentTip to the expression"},{"newline":false,"@type":"Output","id":"id_f3b93145_c74b_4a9c_adce_11fbbcaa449e","value":"\"15% Tip: $\""},{"newline":true,"@type":"Output","id":"id_b7cef4e0_5eff_46e7_921f_e1ac4535f7c8","value":"percentTip"},{"@type":"Assign","name":"percentSalesTax","id":"id_47348d32_69b2_46cc_8175_585a157fdbd9","value":"(percentSalesTax * mealPurchased) + percentSalesTax"},{"@type":"Comment","id":"id_0a557c0f_a78d_4269_908f_8f0802c6428d","text":"Same method used in percentTip is applied here"},{"newline":false,"@type":"Output","id":"id_6483bf67_82c9_4fcd_a285_4c0898a6d7f6","value":"\"7% Sales Tax: $\""},{"newline":true,"@type":"Output","id":"id_e86f018e_99e1_4290_aa6f_7f8852cee96e","value":"percentSalesTax"},{"@type":"Assign","name":"totalAmount","id":"id_15c0ce7d_23f3_42b0_8420_10730b3d7d4e","value":"mealPurchased + percentTip + percentSalesTax"},{"@type":"Comment","id":"id_d6b23bf0_3fcf_40a9_9e74_15715b8136a1","text":"From here, both percent variables contain their newly assigned value, making the sum total easy to achieve"},{"newline":false,"@type":"Output","id":"id_95be20e0_fede_4e0d_af4d_8630bc975866","value":"\"Bill Total: $\""},{"newline":true,"@type":"Output","id":"id_d79acf16_2b98_4a0e_9f63_5c8f9b6bf6c8","value":"totalAmount"},{"@type":"Return","id":"id_fec2979c_7010_4de5_8a75_e73ee488548f","maybeValue":null}],"parameters":[]},"id":"id_56e2c65d_8425_4f81_9388_46d6a6bc1f3c","config":{"showDebugVars":true,"useInputPrompt":false,"echoEnteredValue":false,"showIoBtns":true,"showFunctions":false,"lang":"java","showGenCode":false},"version":"0.3","revision":1196}