by @Garrison Bennett Fork
{"functions":[],"name":"A9-conditional-flowrun_BENNETT","main":{"rawId":"main","tpe":"Void","name":"main","statements":[{"@type":"Begin","id":"id_106c06af_581d_4c0e_8210_4d59232163f9"},{"@type":"Comment","id":"id_d98c1349_5b2c_44be_bd50_9dd5753f3a3f","text":"Part 1 Basic User Question"},{"@type":"Declare","tpe":"Real","name":"earned","id":"id_7a2c0cbd_99c8_4810_8f2f_2b207e144c78","initValue":null},{"@type":"Input","name":"earned","id":"id_c6d576af_5b7e_4ff9_a599_235504efcc7b","prompt":"How much money did you earn this week? "},{"falseBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_cba41dc3_4444_4dde_852e_3240f4c1d941","value":"\"Not bad, keep working hard!\""}],"id":"id_95009215_ee4a_4f9a_b49e_156de44fba43"},"trueBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_7d1ca98e_5fd2_4fc6_b418_84d947179c71","value":"\"That's pretty good!\""}],"id":"id_697c1718_487e_4a09_bb27_af9236f287cc"},"condition":"earned >= 300","@type":"If","id":"id_e48cd7af_fd99_478c_bc46_c202795df048"},{"@type":"Comment","id":"id_95fbfbde_6f9d_43c3_9b1f_9aef1904b662","text":"Part 2 Basic User Question"},{"@type":"Declare","tpe":"Real","name":"rent","id":"id_35c5710d_46ae_4d47_b75a_e91bd0058289","initValue":null},{"@type":"Declare","tpe":"String","name":"answer","id":"id_d5dea708_aa07_4355_a669_ba6158607497","initValue":null},{"@type":"Input","name":"answer","id":"id_8728adc7_cc06_4cea_96db_378b3039647a","prompt":"Did you pay rent this week, yes or no?"},{"falseBlock":{"statements":[{"@type":"Assign","name":"rent","id":"id_9d4df91b_67f0_4a64_af91_48a468848f30","value":"0"}],"id":"id_58223c6b_4e54_4fce_8689_6fabc20b3f50"},"trueBlock":{"statements":[{"@type":"Input","name":"rent","id":"id_93f7ed16_2f51_4618_972d_586a13b72e56","prompt":"How much did you pay for rent?"}],"id":"id_0ec81a2c_0eaa_4324_9d19_79ee2e1961a1"},"condition":"answer == \"yes\" || answer == \"Yes\"","@type":"If","id":"id_597bf4ee_a5cb_453c_916b_574eef72f388"},{"newline":true,"@type":"Output","id":"id_6a176dc5_9c33_4065_b64a_7ff69e9d8c8f","value":"\"You have $\" + (earned-rent) + \" left this week!\""},{"@type":"Comment","id":"id_acfa8ab8_5e31_4d42_baa3_5c4fc75285d6","text":"Part 3 More Costs"},{"@type":"Declare","tpe":"Real","name":"internet","id":"id_ff40904a_a0b0_495e_ab88_7230a3976154","initValue":null},{"@type":"Declare","tpe":"Integer","name":"phone","id":"id_1e78025f_1679_43fe_ad4b_98f8e47f1981","initValue":null},{"@type":"Declare","tpe":"Integer","name":"gas","id":"id_49bf40b5_8598_4b60_90c8_71562da83f52","initValue":null},{"@type":"Declare","tpe":"Integer","name":"food","id":"id_a58cbaf6_1a73_444f_87d1_fc6ba44605fb","initValue":null},{"@type":"Input","name":"answer","id":"id_ff03494c_ed21_4243_abd2_bb5048ab08d8","prompt":"Did you pay for internet this week, yes or no?"},{"falseBlock":{"statements":[{"@type":"Assign","name":"internet","id":"id_505de7ba_8647_4eb7_b060_cafdb73fcee9","value":"0"}],"id":"id_c531c261_0533_4bfc_aa4b_77f1316e1c53"},"trueBlock":{"statements":[{"@type":"Input","name":"internet","id":"id_c7245044_7342_4a85_9c7c_077f29916466","prompt":"How much did you pay for internet?"}],"id":"id_0831be0b_46dd_4f3f_98ac_0c40e0a85eca"},"condition":"answer == \"Yes\" || answer == \"yes\"","@type":"If","id":"id_59d13d7e_1ec0_46ac_b3fc_645c04b14927"},{"@type":"Input","name":"answer","id":"id_349c9504_aa0a_45f2_925c_984fc37bb452","prompt":"Did you pay for your phone this week, yes or no?"},{"falseBlock":{"statements":[{"@type":"Assign","name":"phone","id":"id_b754c655_acfa_4e89_8d0d_03d1b961be54","value":"0"}],"id":"id_4dc37110_f662_46fa_afa6_3cc0327cec45"},"trueBlock":{"statements":[{"@type":"Input","name":"phone","id":"id_8322b133_3223_4ef0_9e61_ac3093955a7c","prompt":"How much did you pay for your phone?"}],"id":"id_c61eabbc_f8f7_49ac_a650_5bbee7199eb0"},"condition":"answer == \"Yes\" || answer == \"yes\"","@type":"If","id":"id_66977f92_f25c_4e1f_8c5f_637992f2f09c"},{"@type":"Input","name":"answer","id":"id_e25e8a62_b19e_4dc0_b303_8f4e3927ca01","prompt":"Did you pay for gas this week, yes or no?"},{"falseBlock":{"statements":[{"@type":"Assign","name":"gas","id":"id_fd47842d_b35b_46da_9401_1c17c1fc2d80","value":"0"}],"id":"id_f8634466_a7c6_4655_9551_3264097567b7"},"trueBlock":{"statements":[{"@type":"Input","name":"gas","id":"id_85515c09_6e42_457d_8607_539a7c0129b2","prompt":"How much did you pay for gas?"}],"id":"id_bb25ff68_5b6a_47e5_836d_018598f16687"},"condition":"answer == \"Yes\" || answer == \"yes\"","@type":"If","id":"id_34a7fe63_277d_4ea2_9968_47663f47d835"},{"@type":"Input","name":"answer","id":"id_ae923ced_9e14_4c73_966e_1a25a596be15","prompt":"Did you pay for food this week, yes or no?"},{"falseBlock":{"statements":[{"@type":"Assign","name":"food","id":"id_306db0dd_60d8_455f_87ef_c9cd5609e5be","value":"0"}],"id":"id_2d1b80d4_fd3e_4b7c_9b90_205ba464b285"},"trueBlock":{"statements":[{"@type":"Input","name":"food","id":"id_92723c23_23d7_4764_8b73_90e8c616af90","prompt":"How much did you pay for food?"}],"id":"id_a9e74724_0df7_4a4a_aae0_96479d5f56a7"},"condition":"answer == \"Yes\" || answer == \"yes\"","@type":"If","id":"id_410a059e_8ecb_4e51_afa2_a4ddde6a27a6"},{"newline":true,"@type":"Output","id":"id_00dd0507_6764_4a6c_b6f8_3b07a6f3ca46","value":"\"After these expenses, you have $\" + (earned-rent-internet-phone-gas-food) + \" left this week!\""},{"@type":"Comment","id":"id_b8257351_f911_49f3_983b_99ce7bed0e6c","text":"Part 4 Pay Rate"},{"@type":"Declare","tpe":"Real","name":"income","id":"id_2fa8a262_990c_4364_8cc3_ff5e5bc26b8e","initValue":null},{"@type":"Declare","tpe":"Real","name":"hours","id":"id_1ad67351_cc7a_429a_89d6_45607ab0f198","initValue":null},{"@type":"Declare","tpe":"Integer","name":"pay","id":"id_ce999a8c_df9c_4b01_8b04_77b962bbb512","initValue":null},{"@type":"Input","name":"hours","id":"id_37152d4f_3de6_4811_9d8c_afb216829308","prompt":"How many hours did you work this week?"},{"@type":"Input","name":"pay","id":"id_2a9b937e_c8ba_4803_8788_082d72526aca","prompt":"What is your hourly pay rate (how much do you make per hour)?"},{"falseBlock":{"statements":[{"@type":"Assign","name":"income","id":"id_ff4b2a66_489a_48c4_b4a6_7f6313d54234","value":"hours*pay"}],"id":"id_3b7fbaa3_179d_43f9_8fee_041683f090ba"},"trueBlock":{"statements":[{"@type":"Assign","name":"income","id":"id_d9717771_5b74_4639_8d81_107276cd460c","value":"(40*pay)+((hours-40)*(1.5*pay))"}],"id":"id_2c58268e_4e12_4e7e_a31e_845031c211ca"},"condition":"hours > 40","@type":"If","id":"id_8ea69967_05df_4c6b_bc62_d8e45ee576d7"},{"newline":true,"@type":"Output","id":"id_5bab2700_7157_4cb3_9682_f3ca785bc4eb","value":"\"You made $\" + income + \" this week!\""},{"@type":"Return","id":"id_fb5905d1_51f4_4576_9338_264c74a1f482","maybeValue":null}],"parameters":[]},"id":"id_5712ca24_dd1f_4172_914f_67b7bdaafaa4","config":{"showDebugVars":true,"showIoBtns":true,"showFunctions":true,"lang":"javascript","showGenCode":true},"version":"0.2","revision":1198}