This way of thinking combines some of the best features of mathematics, engineering, and natural science.

  • Like mathematicians, computer scientists use formal languages to denote ideas (specifically computations).
  • Like engineers, they design things, assembling components into systems and evaluating tradeoffs among alternatives.
  • Like scientists, they observe the behavior of complex systems, form hypotheses, and test predictions.

The single most important skill for a computer scientist is problem solving. Problem solving means:

  1. the ability to formulate problems
  2. think creatively about solutions
  3. express a solution clearly and accurately

Algorithm

If problem solving is a central part of computer science, then the solutions that you create through the problem solving process are also important. In computer science, we refer to these solutions as algorithms. An algorithm is a step by step list of instructions that if followed exactly will solve the problem under consideration.

Programming Language

  • Machine language: the encoding of instructions in binary, which can be directly executed by the computer.
  • Assembly language: uses a slightly easier format to refer to the low level instructions.
  • High-level language: (even those in assembly language) have to be processed before they can run.

interpreters

image.png

compilers

image.png

Programs

input

Get data from the keyboard, a file, or some other device.

output

Display data on the screen or send data to a file or other device.

math and logic

Perform basic mathematical operations like addition and multiplication and logical operations like and, or, and not.

conditional execution

Check for certain conditions and execute the appropriate sequence of statements.

repetition

Perform some action repeatedly, usually with some variation.

Debugging

Programming is the process of writing and gradually debugging a program until it does what you want.

syntax errors

The structure of a program and the rules about that structure.

runtime errors

The error does not appear until you run the program. These errors are also called exceptions because they usually indicate that something exceptional (and bad) has happened.

semantic errors

If there is a semantic error in your program, it will run successfully in the sense that the computer will not generate any error messages. However, your program will not do the right thing. It will do something else.

the for Loop

image.png