A computer is an electronic device that can automatically accept input data, process it, and output the results. It has three main components: the input unit, central processing unit (CPU), and output unit. The CPU contains the memory, arithmetic logic unit (ALU), and control unit. The input unit includes devices like keyboards, mice, and scanners that allow data to enter the computer. The output unit contains displays and printers that output the processed results. The CPU manages and controls all computer operations by storing data and instructions in memory and using the ALU to perform calculations under the control unit's direction.