<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?action=history&amp;feed=atom&amp;title=Pseudocode_and_comments</id>
	<title>Pseudocode and comments - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?action=history&amp;feed=atom&amp;title=Pseudocode_and_comments"/>
	<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;action=history"/>
	<updated>2026-04-17T11:26:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=259&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=259&amp;oldid=prev"/>
		<updated>2025-10-03T13:53:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:53, 3 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l27&quot;&gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Again, lists are unnecessary to solve the exercises, but you can make 2 solutions if you want to show your list skills.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Again, lists are unnecessary to solve the exercises, but you can make 2 solutions if you want to show your list skills.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average and print it. Continue to ask for file names and calculate the average in the given file and print it until you enter nothing - no file name. Test on the files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039; &amp;amp; &#039;&#039;ex1_3.dat&#039;&#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&#039;&#039;ex1.acc&#039;&#039;  &amp;amp; &#039;&#039;ex1.dat&#039;&#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average and print it. Continue to ask for file names and calculate the average in the given file and print it until you enter nothing - no file name. Test on the files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039; &amp;amp; &#039;&#039;ex1_3.dat&#039;&#039;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&#039;&#039;ex1.acc&#039;&#039;  &amp;amp; &#039;&#039;ex1.dat&#039;&#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output. Note: using strip() or something similar will be required in this exercise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&#039;&#039;ex1.acc&#039;&#039;  &amp;amp; &#039;&#039;ex1.dat&#039;&#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &#039;&#039;numbers1.txt&#039;&#039; and &#039;&#039;numbers2.txt&#039;&#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &#039;&#039;numbers3.txt&#039;&#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting. If you have difficultly imagining this, write two columns of numbers (no duplicates) on paper and merge the two columns into one by hand. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&#039;&#039;ex1.acc&#039;&#039;  &amp;amp; &#039;&#039;ex1.dat&#039;&#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output. Note: using strip() or something similar will be required in this exercise.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &#039;&#039;numbers3.txt&#039;&#039;. In the file &#039;&#039;badnumbers.txt&#039;&#039; is a sorted list of bad numbers. If any of these numbers are in &#039;&#039;numbers3.txt&#039;&#039; they must be removed and a new file with only the good numbers &#039;&#039;goodnumbers.txt&#039;&#039; must be created. No lists, no sorting. Hint: There are 8 bad numbers in &#039;&#039;numbers3.txt&#039;&#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &#039;&#039;numbers1.txt&#039;&#039; and &#039;&#039;numbers2.txt&#039;&#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &#039;&#039;numbers3.txt&#039;&#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting. If you have difficultly imagining this, write two columns of numbers (no duplicates) on paper and merge the two columns into one by hand.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &#039;&#039;numbers3.txt&#039;&#039;. In the file &#039;&#039;badnumbers.txt&#039;&#039; is a sorted list of bad numbers. If any of these numbers are in &#039;&#039;numbers3.txt&#039;&#039; they must be removed and a new file with only the good numbers &#039;&#039;goodnumbers.txt&#039;&#039; must be created. No lists, no sorting. Hint: There are 8 bad numbers in &#039;&#039;numbers3.txt&#039;&#039;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=235&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=235&amp;oldid=prev"/>
		<updated>2025-09-15T13:02:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:02, 15 September 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output. Note: using strip() or something similar will be required in this exercise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output. Note: using strip() or something similar will be required in this exercise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &#039;&#039;numbers1.txt&#039;&#039; and &#039;&#039;numbers2.txt&#039;&#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &#039;&#039;numbers3.txt&#039;&#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &#039;&#039;numbers1.txt&#039;&#039; and &#039;&#039;numbers2.txt&#039;&#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &#039;&#039;numbers3.txt&#039;&#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you have difficultly imagining this, write two columns of numbers (no duplicates) on paper and merge the two columns into one by hand.  &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039;. In the file &amp;#039;&amp;#039;badnumbers.txt&amp;#039;&amp;#039; is a sorted list of bad numbers. If any of these numbers are in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; they must be removed and a new file with only the good numbers &amp;#039;&amp;#039;goodnumbers.txt&amp;#039;&amp;#039; must be created. No lists, no sorting. Hint: There are 8 bad numbers in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039;. In the file &amp;#039;&amp;#039;badnumbers.txt&amp;#039;&amp;#039; is a sorted list of bad numbers. If any of these numbers are in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; they must be removed and a new file with only the good numbers &amp;#039;&amp;#039;goodnumbers.txt&amp;#039;&amp;#039; must be created. No lists, no sorting. Hint: There are 8 bad numbers in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=234&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=234&amp;oldid=prev"/>
		<updated>2025-09-15T13:00:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:00, 15 September 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l29&quot;&gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average and print it. Continue to ask for file names and calculate the average in the given file and print it until you enter nothing - no file name. Test on the files &amp;#039;&amp;#039;ex1_1.dat&amp;#039;&amp;#039;, &amp;#039;&amp;#039;ex1_2.dat&amp;#039;&amp;#039; &amp;amp; &amp;#039;&amp;#039;ex1_3.dat&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average and print it. Continue to ask for file names and calculate the average in the given file and print it until you enter nothing - no file name. Test on the files &amp;#039;&amp;#039;ex1_1.dat&amp;#039;&amp;#039;, &amp;#039;&amp;#039;ex1_2.dat&amp;#039;&amp;#039; &amp;amp; &amp;#039;&amp;#039;ex1_3.dat&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&#039;&#039;ex1.acc&#039;&#039;  &amp;amp; &#039;&#039;ex1.dat&#039;&#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&#039;&#039;ex1.acc&#039;&#039;  &amp;amp; &#039;&#039;ex1.dat&#039;&#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Note: using strip() or something similar will be required in this exercise&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &amp;#039;&amp;#039;numbers1.txt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;numbers2.txt&amp;#039;&amp;#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &amp;#039;&amp;#039;numbers1.txt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;numbers2.txt&amp;#039;&amp;#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039;. In the file &amp;#039;&amp;#039;badnumbers.txt&amp;#039;&amp;#039; is a sorted list of bad numbers. If any of these numbers are in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; they must be removed and a new file with only the good numbers &amp;#039;&amp;#039;goodnumbers.txt&amp;#039;&amp;#039; must be created. No lists, no sorting. Hint: There are 8 bad numbers in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039;. In the file &amp;#039;&amp;#039;badnumbers.txt&amp;#039;&amp;#039; is a sorted list of bad numbers. If any of these numbers are in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; they must be removed and a new file with only the good numbers &amp;#039;&amp;#039;goodnumbers.txt&amp;#039;&amp;#039; must be created. No lists, no sorting. Hint: There are 8 bad numbers in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=233&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=233&amp;oldid=prev"/>
		<updated>2025-09-15T12:47:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:47, 15 September 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l27&quot;&gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Again, lists are unnecessary to solve the exercises, but you can make 2 solutions if you want to show your list skills.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Again, lists are unnecessary to solve the exercises, but you can make 2 solutions if you want to show your list skills.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average. Continue to ask for file names and calculate the average in the given file until you enter nothing - no file name. Test on the files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039; &amp;amp; &#039;&#039;ex1_3.dat&#039;&#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and print it&lt;/ins&gt;. Continue to ask for file names and calculate the average in the given file &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and print it &lt;/ins&gt;until you enter nothing - no file name. Test on the files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039; &amp;amp; &#039;&#039;ex1_3.dat&#039;&#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=109&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=109&amp;oldid=prev"/>
		<updated>2025-08-27T21:50:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:50, 27 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &amp;#039;&amp;#039;numbers1.txt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;numbers2.txt&amp;#039;&amp;#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &amp;#039;&amp;#039;numbers1.txt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;numbers2.txt&amp;#039;&amp;#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &#039;&#039;numbers3.txt&#039;&#039;. In the file &#039;&#039;badnumbers.txt&#039;&#039; is a sorted list of bad numbers. If any of these numbers are in &#039;&#039;numbers3.txt&#039;&#039; they must be removed and a new file with only the good numbers &#039;&#039;goodnumbers.txt&#039;&#039; must be created. No lists, no sorting.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &#039;&#039;numbers3.txt&#039;&#039;. In the file &#039;&#039;badnumbers.txt&#039;&#039; is a sorted list of bad numbers. If any of these numbers are in &#039;&#039;numbers3.txt&#039;&#039; they must be removed and a new file with only the good numbers &#039;&#039;goodnumbers.txt&#039;&#039; must be created. No lists, no sorting&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Hint: There are 8 bad numbers in &#039;&#039;numbers3.txt&#039;&#039;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=108&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=108&amp;oldid=prev"/>
		<updated>2025-08-27T21:47:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:47, 27 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &amp;#039;&amp;#039;numbers1.txt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;numbers2.txt&amp;#039;&amp;#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &amp;#039;&amp;#039;numbers1.txt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;numbers2.txt&amp;#039;&amp;#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &#039;&#039;numbers3.txt&#039;&#039;. In the file &#039;&#039;badnumbers.txt&#039;&#039; is a sorted list of bad numbers. If any of these numbers are in &#039;&#039;numbers3.txt&#039;&#039; they must be removed and a new file with only the good numbers &#039;&#039;goodnumbers.txt&#039;&#039; must be created. No &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;list&lt;/del&gt;, no sorting.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Unfortunately, some bad numbers got mixed into &#039;&#039;numbers3.txt&#039;&#039;. In the file &#039;&#039;badnumbers.txt&#039;&#039; is a sorted list of bad numbers. If any of these numbers are in &#039;&#039;numbers3.txt&#039;&#039; they must be removed and a new file with only the good numbers &#039;&#039;goodnumbers.txt&#039;&#039; must be created. No &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lists&lt;/ins&gt;, no sorting.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=106&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=106&amp;oldid=prev"/>
		<updated>2025-08-27T21:45:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:45, 27 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l28&quot;&gt;Line 28:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average. Continue to ask for file names and calculate the average in the given file until you enter nothing - no file name. Test on the files &amp;#039;&amp;#039;ex1_1.dat&amp;#039;&amp;#039;, &amp;#039;&amp;#039;ex1_2.dat&amp;#039;&amp;#039; &amp;amp; &amp;#039;&amp;#039;ex1_3.dat&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average. Continue to ask for file names and calculate the average in the given file until you enter nothing - no file name. Test on the files &amp;#039;&amp;#039;ex1_1.dat&amp;#039;&amp;#039;, &amp;#039;&amp;#039;ex1_2.dat&amp;#039;&amp;#039; &amp;amp; &amp;#039;&amp;#039;ex1_3.dat&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Read the file &#039;&#039;orphans.sp&#039;&#039; and find all accession numbers (and only the accession numbers), save them in another file of your choosing. Hint: an accession number might look like this AB000114.CDS.1 or like this AB000114 or like this AB000114.CDS.3. CDS means CoDing Sequence followed by a number. If the accession number contains the CDS part, consider .CDS.1 as a part of the accession number. Accession numbers differ in length for historical reasons. You can assume that the accession number comes straight after the &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039;, which is first on the line.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &amp;#039;&amp;#039;numbers1.txt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;numbers2.txt&amp;#039;&amp;#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The files &amp;#039;&amp;#039;numbers1.txt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;numbers2.txt&amp;#039;&amp;#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &amp;#039;&amp;#039;numbers3.txt&amp;#039;&amp;#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Unfortunately, some bad numbers got mixed into &#039;&#039;numbers3.txt&#039;&#039;. In the file &#039;&#039;badnumbers.txt&#039;&#039; is a sorted list of bad numbers. If any of these numbers are in &#039;&#039;numbers3.txt&#039;&#039; they must be removed and a new file with only the good numbers &#039;&#039;goodnumbers.txt&#039;&#039; must be created. No list, no sorting.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=105&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=105&amp;oldid=prev"/>
		<updated>2025-08-27T21:16:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:16, 27 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Now copy/print the lines in the input files into the output file so that the first line of each input file are merged together with a tab and becomes the first line of the output. Continue that way with all the lines in the input file. A mental picture of what is supposed to happen is this: Imagine the 2 input files to be two pieces of paper with lines. In the exercise before the papers were put one after the other in the output. In this exercise the papers are put next to each other (sideways) in the output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# The files &#039;&#039;numbers1.txt&#039;&#039; and &#039;&#039;numbers2.txt&#039;&#039; contain 100 different numbers each in sorted order. Write a program that merges these two files in &#039;&#039;numbers3.txt&#039;&#039; which will then contain all 200 numbers in sorted order. No matter what you think, this does not require lists nor extra sorting.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Playing time again. Make the guessing program (lesson 1, exercise 9) count how many attempts it needed to guess the number and print it when done guessing. It must be able to detect if you lie (and say so, of course). Also, if you haven&amp;#039;t done it before, make the program guess in the fewest possible guesses (an example of &amp;#039;binary search&amp;#039;). This is what most people naturally do by themselves when they play the game. You &amp;#039;just&amp;#039; have to do it in the program. There is a system, a method - find it. Hint: it is probably better to start over than reuse your old program.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=92&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises to be handed in */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=92&amp;oldid=prev"/>
		<updated>2025-08-27T17:03:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises to be handed in&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:03, 27 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l27&quot;&gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Again, lists are unnecessary to solve the exercises, but you can make 2 solutions if you want to show your list skills.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Again, lists are unnecessary to solve the exercises, but you can make 2 solutions if you want to show your list skills.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average. Continue to ask for file names and calculate the average until you enter nothing - no file name. Test on the files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039; &amp;amp; &#039;&#039;ex1_3.dat&#039;&#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for a file name, read the numbers in the file, calculating the average. Continue to ask for file names and calculate the average &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;in the given file &lt;/ins&gt;until you enter nothing - no file name. Test on the files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039; &amp;amp; &#039;&#039;ex1_3.dat&#039;&#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Read the file &amp;#039;&amp;#039;orphans.sp&amp;#039;&amp;#039; and find all accession numbers (and only the accession numbers), save them in another file of your choosing. Hint: an accession number might look like this AB000114.CDS.1 or like this AB000114 or like this AB000114.CDS.3. CDS means CoDing Sequence followed by a number. If the accession number contains the CDS part, consider .CDS.1 as a part of the accession number. Accession numbers differ in length for historical reasons. You can assume that the accession number comes straight after the &amp;#039;&amp;#039;&amp;#039;&amp;gt;&amp;#039;&amp;#039;&amp;#039;, which is first on the line.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Read the file &amp;#039;&amp;#039;orphans.sp&amp;#039;&amp;#039; and find all accession numbers (and only the accession numbers), save them in another file of your choosing. Hint: an accession number might look like this AB000114.CDS.1 or like this AB000114 or like this AB000114.CDS.3. CDS means CoDing Sequence followed by a number. If the accession number contains the CDS part, consider .CDS.1 as a part of the accession number. Accession numbers differ in length for historical reasons. You can assume that the accession number comes straight after the &amp;#039;&amp;#039;&amp;#039;&amp;gt;&amp;#039;&amp;#039;&amp;#039;, which is first on the line.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Ask for 2 input file names (&amp;#039;&amp;#039;ex1.acc&amp;#039;&amp;#039;  &amp;amp; &amp;#039;&amp;#039;ex1.dat&amp;#039;&amp;#039; are good) and an output file name. Copy (read and write) the input files into the output file, one after the other.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=90&amp;oldid=prev</id>
		<title>WikiSysop at 15:22, 27 August 2025</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Pseudocode_and_comments&amp;diff=90&amp;oldid=prev"/>
		<updated>2025-08-27T15:22:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:22, 27 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Exercises for extra practice ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Exercises for extra practice ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Ask for a filename. Open the file and read and display the lines in a loop. However, if the line is empty, do not display it. Try on &#039;&#039;mixedlines.txt&#039;&#039;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
</feed>