{"functions":[],"name":"Reilly - Module 7 Assignment","main":{"rawId":"main","tpe":"Void","name":"main","statements":[{"@type":"Begin","id":"id_1e5fc9c2_70ed_4ea0_aa08_703a1070ca32"},{"@type":"Comment","id":"id_4600fd66_b79b_4869_aa94_ef97ce3290f6","text":"First we declare and assign the needed variables."},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"count","lengthValue2":"5","id":"id_9748b57b_5e95_44e3_a401_9cfe6f6b5acd","initValue":null},{"@type":"Assign","name":"count","id":"id_a5d9d404_a59b_4bb9_b0f1_0e0f8b647c9a","value":"0"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"testScore","lengthValue2":"5","id":"id_5514b884_4faf_4775_850e_0919662e03c5","initValue":null},{"@type":"Assign","name":"testScore","id":"id_261c7143_66f1_480e_ad1c_2e4f24ba53e4","value":"0"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"sum","lengthValue2":"5","id":"id_62e9b536_3e7f_4989_aa5d_d37070e01bcb","initValue":null},{"@type":"Assign","name":"sum","id":"id_2750e8fe_6b98_4fb0_a8ee_51bdbe4f1e72","value":"0"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Real","name":"average","lengthValue2":"5","id":"id_2a1b8aea_648b_43d2_a84e_e6f08f0a53dc","initValue":null},{"newline":true,"@type":"Output","id":"id_d938e6d5_baa2_453b_81a3_2fd98e7f2c24","value":"\"Enter test scores from 0 to 100.\""},{"newline":true,"@type":"Output","id":"id_b0b5f736_b2ff_4904_830f_1a14aecd0e35","value":"\"To end the program, enter -1.\""},{"@type":"Comment","id":"id_7dea32fb_7838_4375_a1ef_3940728871f2","text":"We then set up the while loop to run as long as the input is not -1."},{"condition":"testScore != -1","@type":"While","id":"id_c13d4ee4_9521_4ed6_bff1_9311915ec5cf","body":{"statements":[{"@type":"Input","name":"testScore","id":"id_be0c3e0e_5b9a_4fd6_b920_020e853f8ec0","prompt":null},{"@type":"Comment","id":"id_505268e0_7a31_4238_b74e_dbcf0c535f34","text":"Making sure the value is between 0 and 100."},{"falseBlock":{"statements":[{"falseBlock":{"statements":[{"@type":"Comment","id":"id_6caeeee9_3ccb_4c1e_9ca1_0c512cee0caf","text":"If the value is not between 0 and 100, we have to let them know."},{"newline":true,"@type":"Output","id":"id_de4394a8_d588_43ac_815a_541c3de22d28","value":"\"Score must be from 0 to 100. Try again.\""}],"id":"id_a4f9e8aa_242d_4ff4_8625_48e46ebd7711"},"trueBlock":{"statements":[{"@type":"Comment","id":"id_240ebd2a_b354_43e8_acc8_f848b8afc36c","text":"Ends the Program."}],"id":"id_9b85ee08_424e_471f_9e96_c413dca0f754"},"condition":"testScore == -1","@type":"If","id":"id_2fc7b0a3_ec8b_49c5_99eb_4d739e3d9a5a"}],"id":"id_f991b502_5998_4b01_8d23_0d0b6157c7db"},"trueBlock":{"statements":[{"@type":"Comment","id":"id_22bdc8ff_90c3_4c40_8f01_248758752615","text":"We add the test score to the sum, while keeping count of how many scores are input."},{"@type":"Assign","name":"sum","id":"id_e8c737b8_2bd7_452b_8de4_72a239ba9a06","value":"sum + testScore"},{"@type":"Assign","name":"count","id":"id_9c57c174_6ded_4ec5_a283_bf70cbec73a2","value":"count + 1"}],"id":"id_557752bb_b52b_4309_a2d3_426f4f14002f"},"condition":"testScore >= 0 && testScore <= 100","@type":"If","id":"id_f64cd6f5_5dd9_4cbe_af5b_98904da1ebc0"}],"id":"id_b788ee92_8c14_4796_8fb6_9057f1aef006"}},{"@type":"Comment","id":"id_cca99c7f_3dc5_4cef_b479_af231eb12f1e","text":"Once they input the end command \"-1\", we calculate the average by dividing the sum by the count."},{"@type":"Assign","name":"average","id":"id_4a09be66_7615_4578_9ac9_4a7c7e198e8f","value":"sum / count"},{"newline":true,"@type":"Output","id":"id_9f407544_65ac_4e10_880e_1b6091eb16b7","value":"\"Score Count: \" + count"},{"newline":true,"@type":"Output","id":"id_3faff2a7_9143_406d_ab62_e0b7fb984ebf","value":"\"Score Total: \" + sum"},{"newline":true,"@type":"Output","id":"id_89a9fad7_549b_4bac_be20_cfb4146c943f","value":"\"Average Score: \" + average"},{"@type":"Return","id":"id_64bb6de1_c102_48ba_b245_7d09c4e84c03","maybeValue":null}],"parameters":[]},"id":"id_d7bfce1c_30d6_4a3f_b238_83147e8d8433","config":{"showDebugVars":true,"useInputPrompt":false,"echoEnteredValue":false,"showIoBtns":true,"showFunctions":false,"lang":"java","showGenCode":false},"version":"0.3","revision":1432}