Essay on Computer Science

Submitted By Alex258
Words: 727
Pages: 3

* Programming is a communication between the computer hardware and the person, to solve tasks and problems. * Programming is mostly done with programming language, but not always. * Demands of the task = which programming language to use. * Steps to solve a problem: * Understanding the problem * Breaking the problem into manageable pieces * Designing a solution * Considering alternatives to the solution and refining the solution * Implementing the solution * Testing the solution and fixing any problems * More code = More errors. * Three types of errors: * Compiler errors * Run-time errors * Logical Errors * Five types of language: * Declarative Language * Object-Oriented Language * Query Language * Web Language * Assembly Language * What you write as code is called source code * What the compiler produces is called target code * Compiler - translates all code at once. * Interpreter - translate code in short bursts. * Java compiles its code into Java Bytecode first, not machine code * First programming language created for the web * The class with the main method becomes the executable, which starts up the program * JCreator is an Integrated Development Environment (IDE) * IDE’s provide the following: * File Management * Compiler * Debugger * Editor * Other Tools * Java has eight primitive data types: * Four types of integers * Two kinds of floating point numbers * One character type * One Boolean data type * Booleans are 1-bit * Variables should not be used for “short lived” data * Constant values cannot be changed.

* In a mathematical expression: * the operation being used is called the operator * the values being operated on are called the operand * The += is known as a compound assignment operator * Java allows us to compound Boolean expressions by using logical operators. * Often, lines of code are executed and omitted * Conditional Statements: * if statements * if-then-else statements * nested statements * else-if statements * switch statements * Rarely is code written for sequential execution * Two types of loops: * Conditional - cycles while some condition is true * Counted - cycles a specified number of times * Strings can be represented as Literal or Explicit * String pool is an area where previously declared literals are saved. * Arrays and Strings are reference data types * Array steps: * Declaring * Creation * Inserting * Accessing * Iterating * Methods are heavily used in OOP languages as they are powerful and an efficient way to program * A method should contain: * Permission * Return type * Method name * Parameters/Arguments * The following questions before a method is created: * What will it do? * Who should be allowed to use it? * What information does it need? * Should it return something back? * What should it be called? * Only one value can be returned by the return statement * Calling a method is easier than declaring one * The ArrayList works as follows: * if data is added to the front, all items are shifted * if data is added to the end, no item moves * if an element