by @sheyli Fork
{"functions":[],"name":"Speed Limit","main":{"rawId":"main","tpe":"Void","name":"main","statements":[{"@type":"Begin","id":"id_7e69bee1_848f_452e_ad5d_06f04545693c"},{"@type":"Comment","id":"id_ef328e6b_b86c_47a4_9d18_c2050f1f9c6d","text":"This program asks the user for the speed limit and validates it if it's between 20-70 mph. If it doesn't, it asks until a valid speed limit is entered."},{"@type":"Comment","id":"id_233d892c_4123_4335_90b1_aa99324c31a6","text":"Next, it asks for the driver's speed and makes sure that it is at least the speed limit. After, it calculates how many mph the driver was exceeding and displays the result."},{"@type":"Comment","id":"id_13123ee3_a049_43b3_9883_1665747435f1","text":"By: Sheyli Ramirez"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"speedLimit","lengthValue2":"5","id":"id_fe3b8a5e_bd50_4967_b9b0_cf210e539e66","initValue":null},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"driverSpeed","lengthValue2":"5","id":"id_3092ed25_a72e_4b35_bec9_e00522012e1c","initValue":null},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"overSpeed","lengthValue2":"5","id":"id_5ef2500b_4605_43c7_b5d7_a1246d8abc16","initValue":null},{"@type":"Input","name":"speedLimit","id":"id_fd489ded_f50b_47e2_ba5b_59bbee9838ee","prompt":"Enter speed limit (20-70):"},{"condition":"speedLimit < 20 || speedLimit > 70","@type":"While","id":"id_f0d9160d_322a_41c5_b111_f2444a94fba7","body":{"statements":[{"newline":true,"@type":"Output","id":"id_09fb8703_6d91_4564_9d0f_b7832288ef96","value":"\"Invalid, enter 20-70. Try again.\""},{"@type":"Input","name":"speedLimit","id":"id_00fedd1d_cfff_4d4b_85f3_3ab1ef7a7a45","prompt":"Please enter a speed limit between 20 and 70:"}],"id":"id_16d6eef0_9d08_4eb0_b546_25d0b4573b47"}},{"@type":"Input","name":"driverSpeed","id":"id_2bc02107_f7eb_4de0_80c8_5a4d89b4ad70","prompt":"Enter the speed the driver was going:"},{"condition":"driverSpeed < speedLimit","@type":"While","id":"id_ce31ca97_8f55_468f_85e0_b636add319f6","body":{"statements":[{"newline":true,"@type":"Output","id":"id_6745c7ca_48b4_4d87_91a4_51c8e22c258c","value":"\"Driver speed must be at least the speed limit.Try again\""},{"@type":"Input","name":"driverSpeed","id":"id_571a1dcc_a214_412e_86e2_5d4660e152c4","prompt":"Please enter the driver's speed (must be at least the speed limit):"}],"id":"id_2702d131_9f39_4530_b275_4ac67cae2904"}},{"@type":"Assign","name":"overSpeed","id":"id_a5ab2459_5adf_44b9_b40c_262e372715aa","value":"driverSpeed - speedLimit"},{"newline":true,"@type":"Output","id":"id_fe4eb9ab_fee6_4094_9eeb_dbc7c323a84f","value":"\"Driver was going \" + overSpeed + \" mph over the speed limit.\""},{"@type":"Return","id":"id_e413590e_22a1_4bf2_a626_e9aa30a8f504","maybeValue":null}],"parameters":[]},"id":"id_e39558f1_0194_457f_bb93_f176411c3154","config":{"showDebugVars":true,"useInputPrompt":true,"echoEnteredValue":true,"showIoBtns":true,"showFunctions":true,"lang":"java","showGenCode":true},"version":"0.3","revision":1416}