Resulting current waveform of square wave voltage applied to capacitor/inductor
Obvious homework.
I'll talk about the capacitor only.   &quot;In theory&quot; the capacitor will charge &quot;instantly&quot; and you'll have an infinitesimally narrow yet infinitely tall pulse of current.  This is because there's no &quot;R&quot; in the circuit (as you have defined &quot;ideal&quot; components&quot;).    A capacitor charging time is often called the &quot;RC Time constant&quot;.
https://en.wikipedia.org/wiki/RC_time_constant
It's given by the equation:
t=RC
Because &quot;R&quot; is zero, and &quot;C&quot; is non-zero, then &quot;t&quot; must also be zero     i.e. it takes no time to charge the cap.
In the real world, there would be some resistance in your power supply (&quot;output impedance&quot;) that will serve to limit the current even if you have no discrete &quot;R&quot; in your circuit.  To actually calculate anything, you need to know that &quot;R&quot;   (or just tell your professor it happens &quot;instantly&quot; as described above)
Inductors are the exact opposite, but I leave that to you to think about.   The current in an LR circuit can be found on this page:  https://www.electronics-tutorials.ws/inductor/lr-circuits.html
What happens when &quot;R=0&quot; in that equation??