Computer Science - C++
Lesson 1 - Getting Started
Object-Oriented Programming emphasizes the data. OOP attempts to fit the language to the problem. Programmers using OOP design data forms that correspond to the features of a problem. A CLASS is a specification describing such a new data form. An OBJECT is a particular data structure constructed according to that plan.
The steps of running a program depend upon the computer environment and the compiler being used and consist of writing the code, compiling the code, linking the code to create an executable code.
A text editor is used to write the program, it is saved to a file. This file is called the source code for the program.
The source code is compiled. When this happens the source code is translated to the internal language, called machine language, which is used by host computer. The file containing the translated program is the object code for your program.
Link the object code with additional code. A C++ library contains an object code for a collection of computer routines, called functions, to perform basic tasks. Linking combines your object code with object code for the functions used with some standard startup code to produce a runnable version of the program. The file containing this final product is called the executable code.
There are a number of compilers that can be used for programming with C++. These include Unix, Turbo C++, Borland C++, Symantec C++, Metrowerks CodeWarrior C++, and Microsoft Visual C++. As we shall be using Visual C++, our focus will be on this compiler.
Lab Exercise: Study the terms highlighted and be able to define them.
Steps to start a program using Microsoft Visual C++:
1. Click Start, programs, Microsoft Visual Studio 6.0, Microsoft Visual C++ 6.0
2. Click file, new, win32 console application under the projects tab.
3. Change Location to the appropriate place. Example: z:\yourid\cprojects
4. Enter the Project name desired and it will automatically put the same name in the location. Example: 1area
5. Make sure Create: new workspace and Platforms: Win32 are both checked and click ok.
6. Make sure "an empty project" is highlighted and click finish.
7. Read the path to verify it and click finish and ok.
8. Click File, new, c++ source file
9. Enter the file name where it is requested and Click ok.
10. If using the network, click project, settings, and the general tab.
11. In both the Intermediate files and Output files sections, add C:\Debug and click ok.
12. Write your code.
14. Click file, save all.
15. Execute your program by clicking the exclamation mark.