A computer is an electronic device that takes input, processes it, and provides output. It works with binary digits (0s and 1s) and stores data for further processing. The main components of a computer are the motherboard, processor, memory devices like RAM and ROM, storage devices like hard drives and optical drives, power supply, input devices like keyboard and mouse, and output devices like monitors. The processor performs calculations and logical operations. Data is stored on hard drives in tracks and sectors through magnetic encoding of bits as positive and negative polarities. Optical discs like CDs and DVDs store data as lands and pits that do or do not reflect laser light during reading.