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} }
Write a program to calculate the sum of the integers between \(N\) and
\(M\), where \(N\) and \(M\) are values entered by the user. result
=
\(\sum_{n = N}^{M} n\)
>>> %Run
Enter a number: 0
Enter a number: 3
The sum from 0 to 3 is: 6
>>> %Run
Enter a number: -5
Enter a number: 3
The sum from -5 to 3 is: -9
>>> %Run
Enter a number: -8
Enter a number: 8
The sum from -8 to 8 is: 0
>>> %Run
Enter a number: 4
Enter a number: 4
The sum from 4 to 4 is: 4
Insist that the students test their programs by giving them example
test executions.