<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="et">
	<id>http://courses.cs.taltech.ee/w/index.php?action=history&amp;feed=atom&amp;title=ITI0011-2016%3Aharjutus_20</id>
	<title>ITI0011-2016:harjutus 20 - Redigeerimiste ajalugu</title>
	<link rel="self" type="application/atom+xml" href="http://courses.cs.taltech.ee/w/index.php?action=history&amp;feed=atom&amp;title=ITI0011-2016%3Aharjutus_20"/>
	<link rel="alternate" type="text/html" href="http://courses.cs.taltech.ee/w/index.php?title=ITI0011-2016:harjutus_20&amp;action=history"/>
	<updated>2026-04-05T22:39:05Z</updated>
	<subtitle>Selle lehekülje redigeerimiste ajalugu</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>http://courses.cs.taltech.ee/w/index.php?title=ITI0011-2016:harjutus_20&amp;diff=4520&amp;oldid=prev</id>
		<title>Ago: /* Mall */</title>
		<link rel="alternate" type="text/html" href="http://courses.cs.taltech.ee/w/index.php?title=ITI0011-2016:harjutus_20&amp;diff=4520&amp;oldid=prev"/>
		<updated>2016-05-10T04:34:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Mall&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&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;et&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←Vanem redaktsioon&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Redaktsioon: 10. mai 2016, kell 04:34&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-l5&quot; &gt;5. rida:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;5. rida:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;== Mall ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;== Mall ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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 class=&quot;diffchange diffchange-inline&quot;&gt;Muutke allolevat faili ja esitage see.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;import java.util.HashMap;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;import java.util.HashMap;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ago</name></author>
	</entry>
	<entry>
		<id>http://courses.cs.taltech.ee/w/index.php?title=ITI0011-2016:harjutus_20&amp;diff=4519&amp;oldid=prev</id>
		<title>Ago: Uus lehekülg: &#039;== Üldine ==  Kaitsmine: kuni 20. mai 2016&lt;br /&gt; Kaust gitis: EX20  == Mall ==  &lt;source lang=&quot;java&quot;&gt; import java.util.HashMap;  /**  * The farmer who does some hard work and ear...&#039;</title>
		<link rel="alternate" type="text/html" href="http://courses.cs.taltech.ee/w/index.php?title=ITI0011-2016:harjutus_20&amp;diff=4519&amp;oldid=prev"/>
		<updated>2016-05-10T04:27:59Z</updated>

		<summary type="html">&lt;p&gt;Uus lehekülg: &amp;#039;== Üldine ==  Kaitsmine: kuni 20. mai 2016&amp;lt;br /&amp;gt; Kaust gitis: EX20  == Mall ==  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt; import java.util.HashMap;  /**  * The farmer who does some hard work and ear...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Uus lehekülg&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Üldine ==&lt;br /&gt;
&lt;br /&gt;
Kaitsmine: kuni 20. mai 2016&amp;lt;br /&amp;gt;&lt;br /&gt;
Kaust gitis: EX20&lt;br /&gt;
&lt;br /&gt;
== Mall ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import java.util.HashMap;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * The farmer who does some hard work and earns money.&lt;br /&gt;
 */&lt;br /&gt;
public class Farmer {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Constructor.&lt;br /&gt;
     * @param name - farmer name&lt;br /&gt;
     * @param pastWeekSales - sales of the past week.&lt;br /&gt;
     *                      Key 1 indicates Monday, 7 indicates Sunday.&lt;br /&gt;
     */&lt;br /&gt;
    public Farmer(String name, HashMap&amp;lt;Integer, Integer&amp;gt; pastWeekSales) {&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Gets the name of the farmer.&lt;br /&gt;
     * @return the name.&lt;br /&gt;
     */&lt;br /&gt;
    public String getName() {&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Get selling results for the last week.&lt;br /&gt;
     * @return HashMap, see constructor for description.&lt;br /&gt;
     */&lt;br /&gt;
    public HashMap&amp;lt;Integer, Integer&amp;gt; getSellingResults() {&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Converts earned money HashMap to int array, which contains only amounts earned in the same order&lt;br /&gt;
     * as they were earned.&lt;br /&gt;
     * @param sellingResultsHashMap - earnings hashmap of the past week,&lt;br /&gt;
     *                              see constructor for description.&lt;br /&gt;
     * @return - array of ints of earned money (with length of 7) or null.&lt;br /&gt;
     */&lt;br /&gt;
    public int[] sortTheMess(HashMap&amp;lt;Integer, Integer&amp;gt; sellingResultsHashMap) {&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Puts earned money amounts into order.&lt;br /&gt;
     * Notice, this is a static method which means&lt;br /&gt;
     * this is a general method, not connected to the farmer instance.&lt;br /&gt;
     * @param messyArray - unsorted array of ints&lt;br /&gt;
     * @return - sorted array of ints&lt;br /&gt;
     */&lt;br /&gt;
    public static int[] orderEarnings(int[] messyArray) {&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Finds the max value from the earnings.&lt;br /&gt;
     * @param numArray - sorted or not sorted array of ints&lt;br /&gt;
     * @return - max earning during the past week.&lt;br /&gt;
     * 0 in the case max cannot be found.&lt;br /&gt;
     */&lt;br /&gt;
    public static int findTheMax(int[] numArray) {&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Finds average value from the earnings.&lt;br /&gt;
     * @param numArray - sorted or not sorted array of ints&lt;br /&gt;
     * @return - avg earning of the past week.&lt;br /&gt;
     * 0 in the case average cannot be found.&lt;br /&gt;
     */&lt;br /&gt;
    public static double findAvg(int[] numArray) {&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Puts final statistics into HashMap (&amp;quot;Avg&amp;quot;:123.0, &amp;quot;Max&amp;quot;:600.0).&lt;br /&gt;
     * @param avg - avg of earnings&lt;br /&gt;
     * @param max - max of earnings&lt;br /&gt;
     * @return - HashMap of final stats with keys &amp;quot;Avg&amp;quot; and &amp;quot;Max&amp;quot;.&lt;br /&gt;
     */&lt;br /&gt;
    public static HashMap&amp;lt;String, Double&amp;gt; getFinalStats(double avg, int max) {&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Compares sales of the farmer with another farmer&amp;#039;s sales&lt;br /&gt;
     * on a specific day.&lt;br /&gt;
     * @param day - number of weekday&lt;br /&gt;
     * @param strangerSales - other farmer earnings&lt;br /&gt;
     * @return - true if calling farmer sales were bigger. false otherwise.&lt;br /&gt;
     */&lt;br /&gt;
    public boolean compareSales(int day, HashMap&amp;lt;Integer, Integer&amp;gt; strangerSales) {&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Compares the first and the second half of the week based on the sells&lt;br /&gt;
     * if Sunday would be a free day&lt;br /&gt;
     * (compares mon, tue, wed sum to thu, fri, sat sum).&lt;br /&gt;
     * @param salesArr - sells array&lt;br /&gt;
     * @return - true if during the first half of the week earned&lt;br /&gt;
     * as much as on the second half&lt;br /&gt;
     */&lt;br /&gt;
    public boolean checkSalesIfSundayIsFree(int[] salesArr) {&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Sums sales recursively.&lt;br /&gt;
     * No loops here!&lt;br /&gt;
     * @param salesArr - sales array of ints&lt;br /&gt;
     * @param length - length of array (the part to use).&lt;br /&gt;
     *               This can be smaller than salesArr.length&lt;br /&gt;
     * @return - sum of earnings&lt;br /&gt;
     */&lt;br /&gt;
    public int salesSum(int[] salesArr, int length) {&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * To string method override.&lt;br /&gt;
     * @return preformatted string (&amp;quot;Farmer (farmeri nimi) teenis kokku (kokku teenitud summa) €&amp;quot;)&lt;br /&gt;
     */&lt;br /&gt;
    @Override&lt;br /&gt;
    public String toString() {&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ago</name></author>
	</entry>
</feed>