Introduction • Without software, the computer is useless. • Software is developed with programming languages. • C++ is one of the most popular programming languages. – TIOBE Index – LangPop.com – IEEE • C++ is suited for a wide variety of programming tasks.

C++ Versus C • C++ evolved from C, and you can think of C as being a subset of C++. • So in learning C++, you’re also learning C (and then some). C C++

• Other popular languages that evolved from C include Java, C#, Objective-C.

Software • Software: programs that do specific tasks. • System programs control the computer. – Operating system monitors the overall activity of the computer and provides services such as: • Memory management • Input/output activities • Storage management

• Application programs perform a specific task. – Word processors – Spreadsheets – Games

The Language of a Computer • Digital devices (computers, iPods, cell phones, …) use binary code to represent information. This means they store all information (numbers, text, images, music, …) as sequences of 0s and 1s. • Each 0 or 1 in such a sequence is called a bit (short for binary digit). • Example of an 8-bit sequence: 01101100 • A typical song in an MP3 file might contain 40 million bits.

The Language of a Computer (cont’d.) • Byte: – A sequence of eight bits

• Kilobyte (KB): 210 bytes = 1024 bytes • Table 1-1 on page 7(next slide) shows some other related terms. • This is useful general information, but not critical to what we’ll do in this course.

The Language of a Computer (cont’d.)

The Language of a Computer (cont’d.) • At least three different encodings have been used to represent text as sequences of 0s and 1s. • ASCII (American Standard Code for Information Interchange) – 128 characters; see Appendix C in textbook.

• EBCDIC – Formerly used by IBM.

• Unicode – 65,536 characters; covers most modern alphabets.

The Evolution of Programming Languages • Early computers were programmed in machine language., which required the programmer to type sequences of 0s and 1s. • To calculate wages = rate * hours in machine language: 100100 010001

//Load

100110 010010

//Multiply

100010 010011

//Store

The Evolution of Programming Languages (cont’d.) • Assembly language replaces sequences of 0s and 1s with mnemonics (abbreviations such as LOAD or MULT). • Using assembly language instructions, wages = rate * hours can be written as: LOAD rate MULT hour STOR wages

The Evolution of Programming Languages (cont’d.) • High-level languages include Basic, FORTRAN, COBOL, Pascal, C, C++, C#, and Java. Programs written in these language look much more like English. • Compiler: translates a program written in a highlevel language into machine language. • The equation wages = rate * hours can be written in C++ as: wages = rate * hours;

Processing a C++ Program

Processing a C++ Program (cont’d.) • Steps in processing a C++ program: – Use an editor to create source code in C++. – Preprocessor directives begin with # and are processed by the preprocessor. – Compiler: • Checks that the program obeys the language rules. • Translates into machine language (object program).

Processing a C++ Program (cont’d.) • Steps in processing a C++ program (cont’d.): – Linker: • Combines object program with other files to create executable code. • Library: contains prewritten code you can use.

– Loader: • Loads executable program into main memory.

– The last step is to execute the program.

Programming with the Problem Analysis– Coding–Execution Cycle • Algorithm: – Step-by-step problemsolving process – Solution achieved in finite amount of time

• Programming is a process of problem solving.

The Problem Analysis–Coding–Execution Cycle (cont’d.) • Step 1: Analyze the problem. – Outline the problem and its requirements. – Design steps (algorithm) to solve the problem.

• Step 2: Implement the algorithm. – Implement the algorithm in code. – Verify that the algorithm works.

• Step 3: Maintain. – Use and modify the program if the problem domain changes.

Example 1-1 • Design an algorithm to find the perimeter and area of a rectangle. • The perimeter and area of the rectangle are given by the following formulas:

perimeter = 2 * (length + width) area = length * width

Example 1-1 (cont’d.) • Algorithm: – Get length of the rectangle.

– Get width of the rectangle. – Find the perimeter using the following equation: perimeter = 2 * (length + width)

– Find the area using the following equation: area = length * width

chapter 1.pdf

Operating system monitors the overall activity of the computer and provides ... means they store all information (numbers, text, ... to what we'll do in this course.

845KB Sizes 6 Downloads 84 Views

Recommend Documents

Chapter Tour Chapter
Pictures with captions/ Info graphics: Charts and/or maps (page with title):. Biography (People, some info):. Chapter Objectives: Primary Source Documents (Title ...

Chapter 1.2 Chapter 1.4.1
Disk Operating System (DOS). What is DOS, and why learn about it? Microsoft developed the Disk Operating System (DOS) in 1981. DOS, which is sometimes called MS-DOS, was designed for the IBM PC. Windows 98 and Windows. 2000 both support DOS commands

chapter p chapter 1
Write the product in standard form. 5) (3 + 5i)(2 + 9i). 5). Find the product of the complex number and its conjugate. 6) -1 - 5i. 6). CHAPTER 1. Find the domain of ...

CHAPTER ONE
MAPS. 1. The VOC territories in Austronesian-speaking Asia, ca. the 1660s. 2. Indigenous ethno-linguistic groups of Taiwan. 3. Geographic distribution of ...

Chapter 5
not in the domain. The only critical point is x = 0. As x moves away from 0 on either side, the values of y decrease. The function has a local maximum value at (0, ...... (b) Since. ,. dV. dV dr dt dr dt. = we have. 2 . dV dr rh dt dt π. = (c). 2. 2

Chapter 15
373 cancelled each other and there is zero displacement throughout. To put the principle of superposition mathematically, let y1 (x,t) and y2 (x,t) be the displacements due to two wave disturbances in the medium. If the waves arrive in a region simul

Chapter 9
9.1 Introduction. In mathematics, the word, “sequence” is used in much the same way as it is in ordinary English. When we say that a collection of objects is listed ...

Chapter 09
In the late 1700s and early 1800s, he kept notes about his travels .... In 1762, he quit the company. In 1670, the Hudson's Bay Company held trading rights and.

Chapter 15
The most familiar type of waves such as waves on a string, water waves, sound waves, seismic waves, etc. is the so-called mechanical waves. These waves require a medium for propagation, they cannot propagate through vacuum. They involve oscillations

Physics 235 Chapter 3 - 1 - Chapter 3 Oscillations In this Chapter ...
In this Chapter different types of oscillations will be discussed. A particle carrying out oscillatory motion, oscillates around a stable equilibrium position (note: if ...

Chapter 1 – Getting Started Chapter 2 - PSM ... - GCAP CoolCast
What is Garden City Ammonia Program? What is Refrigeration? Why Refrigeration? Why Take an Operator I Course? Is there a Career in the Industrial ...

ACF Central Florida Chapter Named Southeast Region Chapter of the ...
Mar 31, 2016 - Page 1 ... or on Facebook at www. ... Plugrá® European-Style Butter; Vitamix; Ecolab; Allen Brothers; Wisconsin Milk Marketing Board; Atlantic ...

ACF Central Florida Chapter Named Southeast Region Chapter of the ...
Mar 31, 2016 - ... Vitamix; Ecolab; Allen Brothers; Wisconsin Milk Marketing Board; Atlantic Veal & Lamb;. American Technical Publishers; Par-Way Tryson Company; The ... for chefs in the United States, with the Certified Executive Chef®, ... ACF on

Chapter 1 – Getting Started Chapter 2 - PSM ... - GCAP CoolCast
How much Must I Know about Process Safety Management to be an Operator? Are there Any Organizations that Can Help Me in ... “To the Extent they can affect the process” Mean? How do I Properly Document this Training? ... are some Chemical Characte

Chapter 9_86-117p.pdf
These books have Spirit for theme. I shall never ... He said: 'I will make each of them threefold.' He and life .... "My son Bees create honey by gathering the sweet.

Chapter 3
The 4 step numbers in the example below, are also labels ... 3 • 2 = 6 , is just the point 3 on a number line, being scaled by 2 (made twice as far from the origin).

Chapter
order to communicate alarms from patient monitoring and therapeutic ... After implementation of the central application (AM), as specified in the ACM profile,.

Chapter
SPSS (version 12.0, SPSS Inc.) was used for all analysis. .... ence of prehospital ECG predictive of a reduced door-to-balloon time (mean ± SE) by 38.8 ... Lastly, a multivariate logistic regression model was constructed to determine the sig-.

CHAPTER 11 -
Taking a job at Starbucks would mean giving up that $75,000 a year job, the ...... signatures of people who no longer ...... The pagination of this electronic.

Chapter 1
converged to the highest peak because the selective pressure focuses attention to the area of .... thus allowing the formation of non-equal hyper-volume niches. In order to ..... The crossover operator exchanges the architecture of two ANNs in.

Chapter 1
strategy entails, the research findings are difficult to compare. .... rooms (cf. Li 1984; Wu 2001; Yu 2001). Comprehensive Surveys of EFL Learner Behaviours.

Chapter 4
For example, based on historical data, an insurance company could apply ..... ios we explicitly assume that the only goal of data mining is to optimize accuracy.