OK, thats a modem then, not a router. which means you can only have one device connected at a time.
The ideal solution would be to buy a cable router that would enable you to connect more than one thing at a time, if you are going to continue to swap the cables over then make sure both devices are set to obtain IP address automatically (I assume the computer already is as it was working) so on the Xbox goto the system blade, select settings and then network settings and make sure that is set to obtain automatically (DHCP) connect the wire to the XBOX and then turn off the cable modem for 30 sec and back on and the Xbox should pickup an IP, then, when you swap back to the computer you'll need to do the same with the modem.