From e4fdc05a1eb7edf7e7182632e127d710dc7121b9 Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Mon, 30 Mar 2020 08:59:40 +0100 Subject: [PATCH] Remove unnecessary spaces --- ...er-science-igcse-prerelease-pseudocode.txt | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/2020-computer-science-igcse-prerelease-pseudocode.txt b/2020-computer-science-igcse-prerelease-pseudocode.txt index bd4aacd..bef207c 100644 --- a/2020-computer-science-igcse-prerelease-pseudocode.txt +++ b/2020-computer-science-igcse-prerelease-pseudocode.txt @@ -1,4 +1,4 @@ -FUNCTION get_input( dict): +FUNCTION get_input(dict): tmp <- None WHILE (not tmp): tmp <- input().upper().strip() @@ -10,14 +10,14 @@ FUNCTION get_input( dict): RETURN tmp ENDFUNCTION -FUNCTION print_details( dict): +FUNCTION print_details(dict): FOR item in dict.keys(): OUTPUT "%s: $%.2f, %s" % (item, dict[item][0], dict[item][1]) ENDFOR ENDFUNCTION -FUNCTION print_chosen( dict, item): +FUNCTION print_chosen(dict, item): OUTPUT "%s: %s" % (item, dict[item][1]) RETURN dict[item][0] ENDFUNCTION @@ -45,19 +45,19 @@ run <- True devices <- 0 WHILE run: OUTPUT "Choose an option:" - print_details( devices_dict) - device <- get_input( devices_dict) + print_details(devices_dict) + device <- get_input(devices_dict) devices += 1 IF (device in phones_dict.keys()): OUTPUT "Choose an option:" - print_details( sims_dict) - sim_payg <- get_input( sims_dict) + print_details(sims_dict) + sim_payg <- get_input(sims_dict) ENDIF OUTPUT "Choose an option:" - print_details( case_dict) - case <- get_input( case_dict) + print_details(case_dict) + case <- get_input(case_dict) OUTPUT "Which charger(s) would you like? Enter the codes for those you want with a space between them, or enter nothing to choose neither" - print_details( charger_dict) + print_details(charger_dict) chargers <- input().upper().split(" ") FOR item in chargers: IF item not in charger_dict: @@ -65,17 +65,17 @@ WHILE run: ENDIF ENDFOR IF (devices > 1): - total += 0.9 * print_chosen( devices_dict, device) - saving += 0.1 * print_chosen( devices_dict, device) + total += 0.9 * print_chosen(devices_dict, device) + saving += 0.1 * print_chosen(devices_dict, device) ELSE: - total += print_chosen( devices_dict, device) + total += print_chosen(devices_dict, device) ENDIF IF (device in phones_dict): - total += print_chosen( sims_dict, sim_payg) + total += print_chosen(sims_dict, sim_payg) ENDIF - total += print_chosen( case_dict, case) + total += print_chosen(case_dict, case) FOR charger in chargers: - total += print_chosen( charger_dict, charger) + total += print_chosen(charger_dict, charger) ENDFOR OUTPUT "Subtotal: $%.2f" % total run <- True IF (input("Would you like another device (y/n)?").lower().strip()[0] = "y") ELSE False