1 / 16

Computer Science 117

Computer Science 117. Intro to C++ 08/26/13. Today. Discuss Syllabus Brief History of C++ How to Execute a C++ program. Reading assignment. Computer Science 117. Beginning Level Course No Previous Programming Assumed Quite a Bit of Time Spent on Programs and Reading. Syllabus.

neveah
Download Presentation

Computer Science 117

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 & Ritchie • 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/ • 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 <iostream> using namespace std; // Program to figure gravitational force on Mars int main()‏ { double mass, g; double force; cout << "Mass (kg)>"; 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 • <esc> – 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.

More Related