Difference between revisions of "Computer Science Guide"

From Earlham CS Department
Jump to navigation Jump to search
(enumerations)
Line 75: Line 75:
 
END IF
 
END IF
 
</pre>
 
</pre>
 +
  
 
=====switch=====
 
=====switch=====
Line 99: Line 100:
 
}
 
}
 
</pre>
 
</pre>
 +
  
 
=====loops=====
 
=====loops=====
Line 110: Line 112:
 
}
 
}
 
</pre>
 
</pre>
 +
  
 
====enumerations====
 
====enumerations====
Line 119: Line 122:
 
enum class Color {Red, Green, Blue};
 
enum class Color {Red, Green, Blue};
 
</pre>
 
</pre>
 +
  
 
====structures====
 
====structures====

Revision as of 12:40, 20 September 2014

abc


forward

This is a compilation of online resources.

  • resources may be cut and edited to better fit the philosophy of this text


This text is intended to:

  • be simple
  • help those that desire it
  • expose concepts without complexity
  • be accessible by print and web
  • provide links to all sourced information
  • be editable by those without malicious intent


It is not expected that you read this text sequentially or entirely.

  • use this text in whatever way benefits you most


This is NOT a supplement for a traditional academic resource such as a textbook.

notes about text

formatting

citation

  • source links are included above their quotes

note key

  • (TODO: ) is used to indicate necessary changes


composition

reading guide

sources

Wikipedia is relied upon heavily. It was the fastest way to get this project going. Additional sources are welcome to be incorporated where appropriate.


code

overview

http://en.wikipedia.org/wiki/Computer_programming

Programming is a process that leads from an original formulation of a computing problem to executable programs. It involves activities such as analysis, understanding, and generically solving such problems resulting in an algorithm, verification of requirements of the algorithm including its correctness and its resource consumption, implementation (commonly referred to as coding[1][2]) of the algorithm in a target programming language. Source code is written in one or more programming languages (such as C, C++, C#, Java, Python, Smalltalk, JavaScript, etc.). The purpose of programming is to find a sequence of instructions that will automate performing a specific task or solve a given problem. The process of programming thus often requires expertise in many different subjects, including knowledge of the application domain, specialized algorithms and formal logic.


design

http://en.wikipedia.org/wiki/Software_design#Software_Design

Software design is both a process and a model. The design process is a sequence of steps that enable the designer to describe all aspects of the software to be built. It is important to note, however, that the design process is not simply a cookbook. Creative skill, past experience, a sense of what makes “good” software, and an overall commitment to quality are critical success factors for a competent design.

The design model is the equivalent of an architect’s plans for a house. It begins by representing the totality of the thing to be built (e.g., a three-dimensional rendering of the house) and slowly re?nes the thing to provide guidance for constructing each detail (e.g., the plumbing layout). Similarly, the design model that is created for software provides a variety of different views of the computer software. Basic design principles enable the software engineer to navigate the design process.


concepts

conditionals

http://en.wikipedia.org/wiki/Conditional_(computer_programming)#If-then-else_expressions

Conditional statements are features of a programming language which perform different computations or actions depending on whether a boolean condition evaluates to true or false.


if-then-else

http://en.wikipedia.org/wiki/Conditional_(computer_programming)#If-then-else_expressions

IF (boolean condition) THEN
    (consequent)
ELSE
    (alternative)
END IF


switch

http://en.wikipedia.org/wiki/Conditional_(computer_programming)#Case_and_switch_statements

Switch statements (in some languages, case statements) compare a given value with specified constants and take action according to the first constant to match. There is usually a provision for a default action ('else','otherwise') to be taken if no match succeeds.

switch (someCharacter) {
  case 'a':
    onA();
    break;

  case 'x':
    onX();
    break;

  case 'z':
    onYandZ();
    break;

  default:
    onNoMatch();
}


loops

http://en.wikipedia.org/wiki/Control_flow#Loops

A loop is a sequence of statements which is specified once but which may be carried out several times in succession. The code "inside" the loop is obeyed a specified number of times, or once for each of a collection of items, or until some condition is met, or indefinitely.

for (i = 0; i < n; i++) {
     // code
}


enumerations

http://en.wikipedia.org/wiki/Enumerated_type

An enumerated type is a data type consisting of a set of named values called enumerators. The enumerator names are usually identifiers that behave as constants. A variable that has been declared as having an enumerated type can be assigned any of the enumerators as a value. In other words, an enumerated type has values that are different from each other and that can be compared and assigned.

enum class Color {Red, Green, Blue};


structures

classes

style

c++

python