Presentation is loading. Please wait.

Presentation is loading. Please wait.

Instructor: Tina Tian. About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or .

Similar presentations


Presentation on theme: "Instructor: Tina Tian. About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or ."— Presentation transcript:

1 Instructor: Tina Tian

2 About me Email: tina.tian@manhattan.edutina.tian@manhattan.edu Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or email for appointment Website: home.manhattan.edu/~tina.tian/

3 About the Course Monday, Thursday 1:30 - 2:45 PM RLC 104 Textbook: Gaddis 8 th Edition (preferred) Gaddis 7 th Edition Grading: 1 st Midterm Exam (5 th week)15% 2 nd Midterm Exam (10 th week)15% Final Exam30% Lab Assignments and Homework 40%

4 Homework Assignments All are programming. Expect 8 -10 homework Each homework may contain several programming problems. Homework is due a week after being announced. No late work is accepted.

5 Homework Assignments Hard copy electronic copy will not be accepted Source code Screen shot of output/test run

6 Advices Stay close to the computers and try out the example programs! You can work as a team but don’t copy code. Save your programs home.manhattan.edu emails flash drive

7 About MS Visual Studio Integrated Development Environment (IDE) Used to develop console and graphical user interface (GUI) applications Supports C/C++, C#, VB, etc. Visual Studio 2012 Professional (lab) Visual Studio Express: Community 2015 (Free to download onto personal computers)

8 If you are using Mac.. Xcode https://developer.apple.com/xcode/ Free Compiler

9 About C++ High-level language e.g., C++, C, Java, Python, PHP, Visual Basic... Designed to be easy to read and write Low-level language e.g., assembly language ADD X Y Z Assembly language must be translated to machine language (zeros and ones) 0110 1001 1010 1011 Any high-level language program must be translated into machine language for the CPU to execute.

10 Compilers A program that translates a high-level language to a machine language Source code The original program in a high level language Object code The translated version in machine language

11

12 Linkers Some programs we use are already compiled Their object code is available for us to use For example: Input and output routines A Linker combines The object code for the programs we write and The object code for the pre-compiled routines into The machine language program the CPU can run

13

14 Algorithms Algorithm A sequence of precise instructions that leads to a solution Program An algorithm expressed in a language the computer can understand

15

16 Desktop testing: mentally going through the algorithm Testing: running the program on sample input data

17 Object Oriented Programming (OOP) Used for many modern programs Program is viewed as interacting objects Procedural vs. OOP

18 Some history of C++ C++ is derived from C. C developed by Dennis Ritchie at AT&T Bell Labs in the 1970s. Used to maintain UNIX systems a high-level language with many of the features of a low-level language Good for writing system programs, but hard to understand C++ developed by Bjarne Stroustrup at AT&T Bell Labs in the 1980s. Overcame several shortcomings of C Incorporated object oriented programming C remains a subset of C++

19

20 Include Directives #include Preprocessor directive iostream is a library containing definitions of the input and output function Linker Appears at the start of the program, begin with # using namespace std; Tells the compiler to use names in iostream in a “standard” way

21 int main() {//beginning of the main function....//statements return 0; }//end of the program

22 The output function cout c(C++ language)out(output) c(C++ language)in(input) cout<<whatever data you want to output; cout<<“Welcome to CMPT102!”; << represents the flow of the data.

23 Okay, let’s write a hello world program in C++ C++ is fun!

24 Note No extra space between #include Old C++ compilers: iostream.h Statements end with a semi-colon.

25 Program Layout Compiler accepts almost any pattern of line breaks and indentation Programmers format programs so they are easy to read Place opening brace ‘{‘ and closing brace ‘}’ on a line by themselves Indent statements Use only one statement per line

26 .cpp file.exe file

27 More about cout <<: insertion operator cout<<“Hello World”; is equivalent to cout<<“Hello”<<“ World”; is equivalent to cout<<“Hello ”; cout<<“World”;

28 About cout Start a new line \n (need to go inside of the quotes) endl Escape sequence \nnew line \ttab \”“ \\\

29 Comments // This is a comment. /* This is a comment. This is another comment. */

30 Exercise Write a simple program to print to the screen the following. Be sure to add your name in the comment. Hello! I say “C++ is fun!” Good-bye!

31 Readings Chapter 2 Download and install Visual Studio


Download ppt "Instructor: Tina Tian. About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or ."

Similar presentations


Ads by Google