You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and <code>plus</code> operator to add and subtract complex number.</p>
383
383
</li>
384
384
<li>
385
-
<p>Overload the <code>!</code> operator to conjugate the complex number and <code>==</code> and <code>!=</code> for comparison.</p>
385
+
<p>Overload the <code>!</code> operator to conjugate the complex number <code>!ComplexNumber</code>and <code>==</code> and <code>!=</code> for comparison.</p>
386
386
</li>
387
387
<li>
388
388
<p>Create a struct named <code>Class</code> that contains the class size, section and grade. Overload
for it so that it prints "The world ends here !!!". Observe the order in which <code>World</code> and <code>Hero</code>
402
402
contained by it are dropped.</p>
403
403
</li>
404
-
<li></li>
404
+
<li>
405
+
<p>Create a struct named <code>Table</code> that has a generic field <code>legs_info</code> of type <code>T</code>. Create a function (not a method)
406
+
named <code>show</code> that accepts function parameters <code>&Table<Display></code> and displays <code>legs_info</code>. Create 2 variables one
407
+
that contains <code>T</code> of type <code>String: "Work in progress..."</code> and <code>usize: 4</code>.<br/>
408
+
<code>hint:</code> use <code>?Sized</code>.</p>
409
+
</li>
410
+
<li>
411
+
<p>Implement <code>From</code> trait for struct <code>ComplexNumber</code> given a tuple of type <code>(isize, isize)</code>. Form it using <code>from</code>
412
+
and <code>into</code> respectively.</p>
413
+
</li>
414
+
<li>
415
+
<p>Create a function that accepts either <code>ComplexNumber</code> or <code>(isize, isize)</code> to return the <code>mod</code> of ComplexNumber.</p>
0 commit comments