Sie sind auf Seite 1von 3

Notes CS 1-9-13 Computers can carry out a wide range of tasks because they execute different programs, each

s, each of which directs the computer to work on a specific task The computer itself is a machine that stores data (numbers, words, pictures), interacts with devices (the monitor, the sound system, the printer), and executes programs. A computer program tells a computer, in minute detail, the sequence of steps that are needed to fulfill a task. Hardware- Physical computer and peripheral devices Software- The programs the computer execute Programming- the act of designing and implementing computer programs CPU- central processing unit -Heart of the computer -Executes one operation at a time -Performs program control and data processing -Carries out arithmetic operations such as math functions Primary memory- memory chips (RAM, ROM) Secondary memory- Secondary storage devices (disk drives, CD, jump drives) User- the human/program using a program that a programmer wrote Output- transmits info through the display, speakers, and printers Input- allows to enter information by using a keyboard or a pointing device such as a mouse The Compiler- a special computer program that translates the higher-level description into a machine instructions for a particular processor

CS 1-11-13 The first line tells the compiler to use the standard namespace -#include <iostream> The second line tells the compiler to use the standard namespace Pseudocode- an Informal code Computer program- a sequence of instructions and decisions Programming- the act of designing and implementing computer programs CS 1-14-13

Variable used to store information (can contain one piece of information at a time) -has an identifier (the name of the variable) -a good name is one that describes the contents of the variable When creating variables, the programmer specifies the type of info to be stored Initialization putting a value into a variable when it is created Number Literal a number written by a programmer Assignment Statement stores a new value in a variable and replaces the last value const a variable whose contents cant be changed and must be sent when created Magic number a number not assigned to a meaning Comments explanations for human readers of your code CS 1-16-13

float standard memory for storing numbers into 6-7 places long double twice the storage of the double int cant be used after 2 billion to -2 billion cmath to use, you must include #include <cmath> to use functions in the library CS 1-18-13

abs is under <cstdlib> cast conversion from one type to another (example: from double to int) cin to read values of variables Manipulator is sent to cout to specify how values should be formatted must include the iomanip header in the program: #included <iomanip> and using namespace std; is also needed setw() makes columns of certain widths

CS 1-23-13 length yields the number of a characters in a string invoked using the dot notion ex: int n = name.length();

substr returns a string that is made from the characters in the string s, starting at character start and containing length characters 1-30-13

Short Circuit Evaluation if a statement in a series is true or false, then it finishes the statement early since the statement is fulfilled Loop a statement that is used to execute one or more statements repeatedly until a goal is reached 2-1-13

Das könnte Ihnen auch gefallen