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
<p>This is the first of the two assignments for this course. It will be graded as pass/fail and you and your group of up to 3 students will need to submit it before the start of the last lecture. Please hand in one assignment per group via the e-mail address <ahref="mailto:[email protected]">[email protected]</a>.</p>
482
+
<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>
482
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>
<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>
490
491
<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>
@@ -502,8 +503,8 @@ <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 3 choices, 2 different endings and the choice to restart 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>
<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>
508
509
<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>
509
510
<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>
@@ -512,11 +513,19 @@ <h1>Text based adventure game</h1>
512
513
<sectionid="hangman" class="level1">
513
514
<h1>Hangman</h1>
514
515
<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>
518
519
<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>
519
520
</div>
521
+
</section>
522
+
<sectionid="caesar-cipher" class="level1">
523
+
<h1>Caesar Cipher</h1>
524
+
<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>
527
+
<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