Common Computer Science References
At the end of this lesson, you will be able to:
understand and create default values for a function
passing parameters
go over Default Values , Computer Based Problem Solving
nil
create a program that has a procedure that accepts an address and then prints it again but formatted nicely
the function will have 1 default parameter, the apartment number it will be "" (null or empty)
not every address has an apartment, so it might not have this values
function should accept (just Canadian addresses):
Addressee
Apt. Number (optional)
Street number
Street name
City
Province
Postal Code
the function should return a single string that looks like a mailing address from Canada Post
you are returning a single string, but with multiple lines!
"\n"
also notice all the text is in upper case!
use named parameters if possible, to ensure it is clear each piece that is being passed over
ENSURE that you test the function from main() at least twice (2), once without the optional parameter and once with the optional parameter
also test when a user places words where a number should be
notice mine keeps looping around until you do enter a number!
recreate the same above program in another language
DO NOT use C, since there is no easy way to use strings!
NOTE: You can turn on "Closed Captions" to see a printout of what is being said by selecting the "CC" button.
You can also have it translate the closed captions by going to "Settings, Subtitles/CC, Auto-translate" and then pick your prefered language.