A computer is an electronic device that can accept data as input, process the data according to instructions, produce output, and store information for future use. It has five basic functions: taking input, storing data and instructions, processing data, generating output, and controlling all other functions. The two main components of a computer are hardware, the physical parts, and software, which are instructions and data. A computer uses input devices to receive data, a central processing unit to process data, primary memory to temporarily store data, secondary storage like hard disks to permanently store data, and output devices to communicate the results.