-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
14 lines (14 loc) · 1.45 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<h2>Multiple cases</h2>
<html>
<head></head>
<body>
<p>In her program, Kate wants to use the following function:</p>
<p style="text-align: center;"><span class="math-tex">\(f(x) = \begin{cases} x ^ 2 + 1 & \quad \text{if } x \leq 0\\ 1\over{x ^ 2} & \quad \text{if } 0 < x < 1\\ x^ 2 - 1 & \quad \text{if } x \geq 1 \end{cases}\)</span></p>
<p>The template for this function is defined below. Your task is to create additional functions (one for each case) and complete <code class="java">f(x)</code>. The additional functions are named <code class="java">f1(x)</code>, <code class="java">f2(x)</code>, and <code class="java">f3(x)</code>.</p>
<p>You do NOT need to work with the input or print anything.</p>
</body>
</html><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">1<br></code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">0.0</code></pre><br><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">0.1<br></code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">99.99999999999999</code></pre><br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 15 seconds</font><br><br>
<b>Caution</b><br><br>
You may see errors in your code or execution results due to missing context. Don’t worry about it, just write the solution and press Check.
<br><br>
<a href="https://hyperskill.org/learn/step/9571">Show topic summary</a>