Chapter 1 Introduction To Computers Programs and C++
Chapter 1 Introduction To Computers Programs and C++
Y. Daniel Liang
Bus
Bus
dot pitch The dot pitch is the amount of space between pixels. The
smaller the dot pitch, the better the display.
1101101010011010
© Copyright 2020 by Pearson Education, Inc. All Rights Reserved.
14
Programming Languages
Machine Language Assembly Language High-Level Language
…
Assembler …
ADDF3 R1, R2, R3
1101101010011010
… …
Welcome Note: Clicking the green button displays the source code with
interactive animation and live run. Internet connection is needed for
this button.
#include <iostream>
using namespace std;
int main()
{
cout << "Programming is fun!" << endl;
cout << "Fundamentals First" << endl;
cout << "Problem Driven" << endl;
return 0;
} WelcomeWithThreeMessages
WelcomeWithThreeMessages
#include <iostream>
using namespace std;
int main()
{
cout << "(10.5 + 2 * 3) / (45 - 3.5) = ";
cout << (10.5 + 2 * 3) / (45 - 3.5) << endl;
return 0;
}
ComputeExpression
ComputeExpression
Source Code
Running }
return 0;
Preprocessor
Modified Source
Code
Compiler
If compilation errors
Stored on the disk
Linker
Result
Syntax Errors
Runtime Errors
Logic Errors
ShowSyntaxErrors
ShowSyntaxErrors
ShowRuntimeErrors
ShowRuntimeErrors
ShowLogicErrors
ShowLogicErrors