70 likes | 80 Views
Learn about computer programming, programming languages, and translation mechanisms from high-level to machine code. Dive into C, C++, Java, and more!
E N D
COP3502: Introduction to Computer Science Yashas Shankar
Computer programming • A program a code that list instructions for computer to executes • There is a mechanism (compiler/translator) to change a program into machine code • Human cannot (easily) understand machine code use programming languages such as C, C++, Java, Visual basic, etc. ** machine code ** 00110011 10101100 00001111 10011010 ** C-program ** for (i=0;i<10;i++) { x[i] = x[i-1] + y[i] }
Languages • Machine language – 0000111100110011 • Assembly – easier for people to read, but still hard to develop applications • High-level language – easier for people to develop applications • Fortran, C, C++, Java, Lisp, Cobal, Basic, Algol, Scheme, Smalltalk, Prolog, etc.
Translation: program machine code ** Assembly code ** LOD #1 STO 128 LOD #0 ADD #1 ** C-program ** for (i=0;i<10;i++) { x[i] = x[i-1] + y[i] } ** Java program ** System.out.println (“Hello my name is Yashas”); ** machine code ** 00110011 10101100 00001111 10011010
Translation: program machine code ** C-program ** ** Assembly code ** ** Assembly code # 2 ** ** Java program ** Pentium-4 ** machine code ** Pentium-5 ** machine code **
Your first program • See handout
Before we leave • Homework#3 due next class • Next class: more on programming • Next week: HTML