Top Banner
CMPT 102 Computer Science II Instructor: Tina Tian
31

Instructor: Tina Tian. About me Email: [email protected]@manhattan.edu Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or email.

Dec 29, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

CMPT 102 Computer Science II

CMPT 102Computer Science IIInstructor: Tina TianAbout meEmail: [email protected]: RLC 203AOffice Hours: Wednesday 1:30 - 4:30 PM or email for appointmentWebsite: home.manhattan.edu/~tina.tian/About the CourseMonday, Thursday 1:30 - 2:45 PM RLC 104Textbook: Gaddis 8th Edition (preferred) Gaddis 7th EditionGrading: 1st Midterm Exam (5th week)15% 2nd Midterm Exam (10th week)15% Final Exam30% Lab Assignments and Homework 40%Homework AssignmentsAll are programming.Expect 8 -10 homeworkEach homework may contain several programming problems.Homework is due a week after being announced.No late work is accepted.Homework AssignmentsHard copy electronic copy will not be acceptedSource codeScreen shot of output/test runAdvicesStay close to the computers and try out the example programs!You can work as a team but dont copy code.Save your programs home.manhattan.eduemailsflash drive

About MS Visual StudioIntegrated Development Environment (IDE)Used to develop console and graphical user interface (GUI) applicationsSupports C/C++, C#, VB, etc.

Visual Studio 2012 Professional (lab)Visual Studio Express: Community 2015 (Free to download onto personal computers)

If you are using Mac..Xcodehttps://developer.apple.com/xcode/FreeCompiler

About C++High-level languagee.g., C++, C, Java, Python, PHP, Visual Basic...Designed to be easy to read and writeLow-level languagee.g., assembly languageADD X Y ZAssembly language must be translated to machine language (zeros and ones)0110 1001 1010 1011Any high-level language program must be translated into machine language for the CPU to execute.CompilersA program that translates a high-level language to a machine languageSource code The original program in a high level languageObject code The translated version in machine language

LinkersSome programs we use are already compiledTheir object code is available for us to useFor example: Input and output routines

A Linker combinesThe object code for the programs we write andThe object code for the pre-compiled routines intoThe machine language program the CPU can run

AlgorithmsAlgorithmA sequence of precise instructions that leads to a solution

ProgramAn algorithm expressed in a language the computer can understand

Desktop testing: mentally going through the algorithmTesting: running the program on sample input data

Object Oriented Programming (OOP)Used for many modern programsProgram is viewed as interacting objects

Procedural vs. OOP

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 systemsa high-level language with many of the features of a low-level languageGood for writing system programs, but hard to understandC++ developed by Bjarne Stroustrup at AT&T Bell Labs in the 1980s.Overcame several shortcomings of CIncorporated object oriented programmingC remains a subset of C++

Include Directives#include Preprocessor directiveiostream is a library containing definitions of the input and output functionLinkerAppears at the start of the program, begin with #using namespace std;Tells the compiler to use names in iostream in a standard wayint main(){//beginning of the main function

....//statements

return 0;}//end of the programThe output function coutc(C++ language)out(output)c(C++ language)in(input)

cout