You are on page 1of 5

1

BES043 Computer Fundamentals and Programming

Introduction

The following experiments are intended for the subject Computer Fundamentals and
Programming. There are two programming language used, which are C++ and the Visual Basic 6.
Experiment 1 up to 12 uses the C++ that uses the Microsoft’s Visual C++ and Experiment 13 up to 19
uses the Visual Basic 6.

Using the C++, locate the Microsoft Visual C++ 6 in the Windows’ start button, under the “All
Programs” category. It is placed in the Microsoft Visual Studio 6 folder or just simply search “C++” and
open the software. When the following window appears, just check the box labeled “Don’t show this
message again.” and click on “Run program.”

In the GUI of the Microsoft Visual C++, close the tip-of-the-day window and select New in the
File Menu. The following window will appear with four tabs to be selected. Choose Files, select “C++
Source File” and press the “OK” button. Now, the coding of the program is ready.
2

Encode the example program below. Save it in the “My Documents” folder. Compile the
program by pressing the build button or simply press the F7 key.

//Example Program:
#include<iostream.h>

int main(void)
{
cout<<"\nWelcome to C++ programmig session!\n";
cin.get();
return 0;
}

A project workspace is needed for the compilation of the program and for the temporary files
produced during the process. Select “yes” when the following window appears.
3

An Output window (located at the bottom of the GUI window of the C++) will display the result
of the compilation if there are errors, warnings, or successful compilation - 0 error(s).

Without errors, the program now is ready to be executed by pressing the “Execute Program”
button or by pressing Ctrl+F5.

If an error occurs, just double click the line of the error message and automatically the GUI
window will point the portion of the program where the error is located. Usually, it points to the next
line as illustrated on the example result below. For the example error, it lacks the semi-colon at the end
of the statement cin.get().
4
To open a C++ file already saved, if there is an open C++ file, close it first by clicking on the
Close Workspace option under the File Menu and select Yes. For the meantime, just load one C++ code
at a time. To open a saved C++, select Open in the File Menu and browse for the file to be opened and
select it.
5

Table of Contents

Activity Number Math Header File 10 ______

Output Formatting 15 ______


Activity 1:
Relational Operators 20 ______
Activity 2:
Logical Operators 26 ______
Activity 3:
Switch-Case Statement 30 ______
Activity 4:
While Statement for Looping 34 ______
Activity 5:
For Statement for Looping 37 ______
Activity 6:
Do-while Statement for Looping 42 ______
Activity 7:
Functions 45 ______
Activity 8:
Global Variables 59 ______
Activity 9:
Array
Activity 10:
Form Button
Activity 11:
Experiment 12: Command Button and Tab Index
Experiment 13:
Experiment 14: Picture Box
Experiment 15:
Experiment 16: File Menu
Experiment 17:
Experiment 18: The Enter Code
Experiment 19:
If-else-If Ladder

Label Highlight

Title

Title Pages Rating

Introduction 1

Data Types 5 ______

You might also like