In main(), the function calls are provided for you as starter code. Write your own function definitions, based on the starter code. (Do not modify the starter code). You will need to add code to begin program execution.

computer science

Description

PROBLEM 1. What’s your postal code?

In main(), the function calls are provided for you as starter code. Write your own function definitions, based on the starter code. (Do not modify the starter code). You will need to add code to begin program execution.


FUNCTION 1: get_input() 

The function get_input() should prompt the user to enter a correctly formatted Canadian postal code, with the format: A1A 1A1 or A1A-1A1, where A is a letter and 1 is a digit, with a space or dash separating the 3rd and 4th characters. 

- Use a loop in get_input() to continually prompt the user for a postal code, until they have entered a correctly formatted Canadian postal code. (This means you should convert user input to uppercase letters, if they input lowercase letters). - Use text like in the expected output below.


get_input() should return a correctly formatted postal code (as a string). 


FUNCTION 2: display_code(postal_code) This function will print the parameter passed in, to the console, like the output below. 


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.