-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
18 lines (18 loc) · 1.93 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<h2>Students</h2>
<html>
<head></head>
<body>
<p>John works at the university. He deals with the information about a lot of students and he decided to create a program that would help him with it. </p>
<p>He devised a system for creating an <strong>id</strong> for each student: first letter of the name, last name, and then the birth year. For example, the id for John Smith (b. 1989) would look like <code class="java">JSmith1989</code>.</p>
<p>John needs help finishing the code for the id and then applying it to the students. Your task is to define an instance attribute <strong>id </strong>in the <code class="java">__init__</code> method, calculate it, create an object of the class <code class="java">Student</code> with the parameters from the input, and print the value of the id. Don't print the value inside of the <code class="java">__init__</code> method!</p>
<p><strong>The input format:</strong></p>
<p>Student information: the first line has <strong>the name</strong>, the second has <strong>the last name</strong>, and the third has <strong>the birth year</strong>.</p>
<p><strong>The output format:</strong></p>
<p>The <strong>id </strong>of the student.</p>
<p>NOTE: the attribute names are case sensitive, so check that the attribute is named exactly <code class="java">id</code>. Other names lead to an <code class="java">AttributeError</code>!</p>
</body>
</html><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">Daniel<br>Smith<br>1993</code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">DSmith1993</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/6669">Show topic summary</a>