You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref="#grading-of-the-assignment" id="toc-grading-of-the-assignment" class="nav-link" data-scroll-target="#grading-of-the-assignment">Grading of the Assignment</a></li>
<p>This is the first of the two assignments for this course. It will be graded as pass/fail. You and your group of up to 3 students will need to submit it <strong>before the start of lecture 7 on scientific programming</strong>. Please hand in one assignment per group via the e-mail address <ahref="mailto:[email protected]">[email protected]</a>.</p>
483
-
<p>In the assignment, you will practice the concepts you learned in the first part of the course. You will find a lot of information online and you are welcome to use generative AI to help you with the assignment. However, you are not allowed to copy the code from other groups and you have to indicate where and how you used AI to help you. Try to use comments to structure and to explain your code. Furthermore, use descriptive variable names and format your code nicely in order to make it more readable.</p>
<h2class="anchored" data-anchor-id="grading-of-the-assignment">Grading of the Assignment</h2>
488
+
<p>It is graded pass/fail and at least 50 % of the tasks in the assignments have to be passed in oder to pass the assigment. You may work in groups of up to three students and you should submit one assignment per group via email to <ahref="mailto:[email protected]">[email protected]</a> before the start of Lecture 7 on scientific programming.</p>
489
+
<p>You may use online resources and generative AI (gAI) for assistance. However, you must not copy code from other groups, and you must include a short paragraph titled <code>How I used generative AI</code> that explains where and how you used gAI.</p>
<p>If you use gAI without including a paragraph on its use (use of gAI is typically easy to spot), the assignment will be marked as failed.</p>
516
+
</div>
517
+
</div>
518
+
</div>
519
+
<p>Use comments and docstrings to explain your code. Do not include gAI-generated meta-comments describing what gAI changed. Thus, keep comments focused on explaining the code itself.</p>
<p>If I find multiple instances of such gAI meta-comments, the assignment will be marked as failed. Keep your comments clean and relevant.</p>
527
+
</div>
528
+
</div>
529
+
</div>
530
+
<p>Use descriptive variable names and format your code consistently to maximize readability. Read the instructions carefully and follow them exactly. gAI may hallucinate additional features that are not required.</p>
<p>Ensure the tasks of the assignment run without any errors or mistakes just by calling <code>uv run [your filename]</code>. If you used external packages, include your <code>pyproject.toml</code> so I can replicate your environments.</p>
<p>In this excercise, you will create a program that is able to calculate the amount of tax a person can get back for a donation. First, research the rules for tax refunds for donations in Germany. Then, create a program that is able to <strong>calculate the amount of tax a person can get back</strong> for a donation. The program should ask the user for the <strong>amount of the donation and the yearly income</strong> and then calculate the amount of tax the user can get back. The program should then print the amount of tax to the console. Note, that the program should also handle wrong inputs from the user, e.g. if the user enters a negative donation amount or a non-numeric income.</p>
<spanid="cb1-2"><ahref="#cb1-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="co">: Create a program that is able to calculate the amount of tax a person can get back for a donation.</span></span>
491
581
<spanid="cb1-3"><ahref="#cb1-3" aria-hidden="true" tabindex="-1"></a><spanclass="co"># Your code here</span></span></code></pre></div><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></div>
@@ -514,7 +604,7 @@ <h1>Tax refund for donations</h1>
<p>In this excercise, you will create a text based adventure game. You are completely free in the choice of the story, but it must <strong>at least include 4 choices, 3 different endings, the choice to restart the game and yourself as a character of the game</strong>. Try to use the concepts of conditionals, loops, and functions to create a game that is both fun and interactive for the user. Note, that the program should also handle wrong inputs from the user, e.g. if the user enters a choice that is not available.</p>
<divclass="code-copy-outer-scaffold"><divclass="sourceCode cell-code" id="cb2"><preclass="sourceCode python code-with-copy"><codeclass="sourceCode python"><spanid="cb2-1"><ahref="#cb2-1" aria-hidden="true" tabindex="-1"></a><spanclass="co"># Test based adventure game</span></span>
519
609
<spanid="cb2-2"><ahref="#cb2-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="co">: Create a text based adventure game with at least 3 choices, 2 different endings and the choice to restart the game.</span></span>
520
610
<spanid="cb2-3"><ahref="#cb2-3" aria-hidden="true" tabindex="-1"></a><spanclass="co"># Your code here</span></span></code></pre></div><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></div>
@@ -523,7 +613,7 @@ <h1>Text based adventure game</h1>
523
613
<sectionid="hangman" class="level1">
524
614
<h1>Hangman</h1>
525
615
<p>In this excercise, you will create a program that is able to play the game Hangman. The program should ask the <strong>game master for a secret word</strong>. Afterward, it should ask the player to guess a letter and then check if the letter is in the word. The program should then print the word with the guessed letters and the number of tries left. The program should also handle wrong inputs from the user, e.g. if the user enters a non-letter or a letter that is already guessed.</p>
<spanid="cb3-2"><ahref="#cb3-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="co">: Create a program that is able to play the game Hangman with a game master and one player.</span></span>
529
619
<spanid="cb3-3"><ahref="#cb3-3" aria-hidden="true" tabindex="-1"></a><spanclass="co"># Your code here</span></span></code></pre></div><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></div>
@@ -532,7 +622,7 @@ <h1>Hangman</h1>
532
622
<sectionid="caesar-cipher" class="level1">
533
623
<h1>Caesar Cipher</h1>
534
624
<p>In this excercise, you will create a program that is able to <strong>encrypt and decrypt messages</strong> using the Caesar Cipher. The program should ask the user for a <strong>message and a key</strong> and whether to encrypt or decrypt the message. The program should then <strong>encrypt the message</strong> by shifting each letter of the message by the key or <strong>decrypt the message</strong> by shifting each letter of the message back by the key. The program should then print the encrypted or decrypted message and asks the user whether to continue with the next message or to quit the program. Note, that you only need to encrypt or decrypt letters, keep other characters unchanged.</p>
<divclass="code-copy-outer-scaffold"><divclass="sourceCode cell-code" id="cb4"><preclass="sourceCode python code-with-copy"><codeclass="sourceCode python"><spanid="cb4-1"><ahref="#cb4-1" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="co">: Create a programm able to encrypt and decrypt messages using the Caesar Cipher.</span></span>
537
627
<spanid="cb4-2"><ahref="#cb4-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># Your code here</span></span></code></pre></div><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></div>
0 commit comments