-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
21 lines (21 loc) · 1.67 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<h2>Let's rock</h2>
<html>
<head></head>
<body>
<p>There are many bands in the world that perform all kinds of music. Let's suppose for a second that you're a fan of rock and want to create a program that deals with rock bands.</p>
<p>For that, you obviously need the class <code class="java">RockBand</code> with such attributes as <code class="java">genre</code> ("rock") and <code class="java">key_instruments</code> (by default, a list <code class="java">["electric guitar", "drums"]</code>). Let's also, for the sake of simplicity, assume <code class="java">n_members</code> to be a class attribute equal to 4, since most rock bands do have 4 members.</p>
<p>Create this class and an object of that class: name the variable after any rock band that you like. Print the attributes of your rock band on separate lines in this order: <strong>genre, </strong><strong>n_members, key_instruments.</strong></p>
<p><button class="btn-sm btn-outline-secondary" onclick="getElementById('hint-802').style.display='inline'"> Hint </button> </p>
<div id="hint-802" style="display:none;">
Make sure that the attributes have correct types:
<code class="java">genre</code> is a string,
<code class="java">n_members</code> is an integer, and
<code class="java">key_instruments</code> is a list.
</div>
<p></p>
</body>
</html><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/6661">Show topic summary</a>