Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science 117 Intro to C++ 08/26/13. Today Discuss Syllabus Brief History of C++ How to Execute a C++ program. Reading assignment.

Similar presentations


Presentation on theme: "Computer Science 117 Intro to C++ 08/26/13. Today Discuss Syllabus Brief History of C++ How to Execute a C++ program. Reading assignment."— Presentation transcript:

1 Computer Science 117 Intro to C++ 08/26/13

2 Today Discuss Syllabus Brief History of C++ How to Execute a C++ program. Reading assignment

3 Computer Science 117  Beginning Level Course  No Previous Programming Assumed  Quite a Bit of Time Spent on Programs and Reading

4 Syllabus You should have a copy

5 Programming What is a Program? What is a Programming Language?

6 C/C++ and linux UNIX written 1969 by Thomas & RitchieUNIX –Bell Labs, PDP-7 C written in early 1970’s by Dennis Ritchie UNIX rewritten in C by Thomas in 1973. C++ written in early 1980’s by Bjarne Stroustrup http://www2.research.att.com/~bs/ http://www2.research.att.com/~bs/ –Object Oriented Programming (OOP)‏ Linux written in 1991 by Linus Torvalds

7 Where is C++ Used? Just about everywhere Mars rovers, animations, graphics, industrial controllers, compilers, chip manufacturing, etc.

8 #include using namespace std; // Program to figure gravitational force on Mars int main()‏ { double mass, g; double force; cout "; cin >> mass; g = 3.7; force = mass * g; cout << force << " newtons\n"; return 0; }

9 Classes and Objects To create two objects of type Planet: class Planet { // class definition }; Planet earth, mars;

10 Executing a C++ Program Login to onyx. Edit the program -- using vi or vim or gvim Compile the program Execute the program How to do this.

11 Login and Password I will hand it out. Don’t lose it. Keep the password a secret.

12 mobaxterm Start it from the start up menu Then: ssh -Y login@onyx

13 Logout exit Important

14 vi Type "vi" at the prompt Two modes – Command – Insert

15 vi Commands a, i – get into insert mode – back to command mode x– delete a character dd, 10dd– delete a line, delete 10 lines. dw – delete a word u– undo : n – Get to line n :wq– save and quit :q!– quit w.o. saving arrow keys– move around

16 Assignments Read in Linux Guide through “Printing Files” –Link off my 117 web page. Read the Quick Reference to the vi Editor. –Link off my 117 web page –Read the vi reference –What are the two modes in the vi editor? Read Chapter 1, of the Horstmann text for next week.


Download ppt "Computer Science 117 Intro to C++ 08/26/13. Today Discuss Syllabus Brief History of C++ How to Execute a C++ program. Reading assignment."

Similar presentations


Ads by Google