A computer consists of both hardware and software. The hardware includes the system unit containing the CPU and RAM, a monitor to display visual output, a keyboard and mouse for input, and peripheral devices like printers and scanners. The software includes operating systems that manage computer resources and provide common services, application software that helps users perform tasks, and compiler software that converts programs into machine-readable format.