A resistor, capacitor, and switch are all connected in series to an ideal battery of constant terminal voltage. Initially, the switch is open and the capacitor is uncharged. What is the voltage across the resistor and the capacitor at the moment the switch is closed