Repository with assignments using the Test Informed Learning with Examples (TILE) method to integrate testing into existing programming courses for free.
Join our LinkedIN Community.
Use the following BibTeX entry to cite this work:
@INPROCEEDINGS{DVMB2023, author={Doorn, Niels and Vos, Tanja and Marín, Beatriz and Barendsen, Erik}, booktitle={2023 IEEE Conference on Software Testing, Verification and Validation (ICST)}, title={Set the right example when teaching programming: Test Informed Learning with Examples (TILE)}, year={2023}, volume={}, number={}, pages={269-280}, doi={10.1109/ICST57152.2023.00033} }
Morse code is a coding scheme that uses hyphens and dots to represent digits and letters. In this exercise, we are going to write a program that uses a dictionary to store the mapping between these symbols and Morse code. Use a dot to represent a Morse dot, and a hyphens to represent a Morse hyphens. The mapping of characters to hyphens and dots is shown in the table below:
First, you have to write a function that translates words written in capitalized English into Morse code. The function must ignore any characters in the word that are not listed in the table above.
After testing the function well, you have to write a program called
main
that calls this function to translate a message that asks the
user. The user’s message can consist of more than one word separated
by a space.
For example, if you are a user, type the message Hello, World
! and
your program must return the following Morse code:
.... . .-.. .-.. --- .-- --- .-. .-.. -..