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} }
The water company is implementing a new billing system. For each house, the invoice is made as follows:
The first 50 litres are free.
Between 50 and 200 litres, each litre is charged at 0.10 euros.
From 200 litres on, each litre is charged at 0.30 euros.
The minimum fee is 6 euros, that is, if the amount to pay is less than 6 euros, then the payment will be 6 euros.
Write a program that calculates the water consumption of a family in a month given the number of litres used.
>>> %Run
Enter the litres of water used: 0
The expense is 6.00€
>>> %Run
Enter the litres of water used: -500
Please enter a correct value
>>> %Run
Enter the litres of water used: 300
The expense is 90.00€
>>> %Run
Enter the litres of water used: 55
The expense is 6.00€
Insist that the students test their programs by giving them example
test executions.