Sunday, 15 September 2013

The Visual Basic Interface with video tutorial


Before we begin Visual Basic 6 programming, let us understand some basic concepts of programming. According to Webopedia, a computer program is an organized list of instructions that, when executed, causes the computer to behave in a predetermined manner. Without programs, computers are useless. Therefore, programming means designing or creating a set of instructions to ask the computer to carry out certain jobs which normally are very much faster than human beings can do.
A lot of people think that computer CPU is a very intelligent thing, which in actual fact it is a dumb and inanimate object that can do nothing without human assistance. The microchips of  a CPU can only understand two distinct electrical states, namely, the on and off states, or 0 and 1 codes in the binary system. So, the CPU only understands a combinations of 0 and 1 codes, a language which we called machine language. Machine language is extremely difficult to learn and it is not for us laymen to master it easily.  Fortunately , we have many smart programmers who wrote interpreters and compilers that can translate human language-like programs such as BASIC into machine language so that the computer can carry out the instructions entered by the users. Machine language  is known as the primitive language while Interpreters and compilers like Visual Basic are called high-level language. Some of the high level computer languages beside Visual Basic are  Fortran, Cobol, Java, C, C++, Turbo Pascal, and etc .  






















Read more ...

Visual Basic Programming An Introduction

Why Visual Basic?
  • H Programming for the Windows User

  • Interface is extremely complicated.

  • H Other Graphical User Interfaces (GUI) areno better.
  • H Visual Basic provides a convenient methodfor building user interfaces.
  • H Visual Basic can interface with code written
in C, for efficiency.


What Visual Basic is not

H Visual Basic is not, a powerful
programming language that enables you to
do anything you want.
H Visual Basic is not, elegant or fast.
H Visual Basic is not, a replacement for C.
H Visual Basic is not, anything like any other
programming language you have ever used.

When You Program in VB:

H You draw pictures of your user interface.
H You draw buttons, text boxes, and other
user-interface items.
H You add little snippets of code to handle the
user interaction.
H You add initialization code, usually as the
last step.
H If you like, you can code more complex
functions. (But many do not.)


Read more ...

Object-Oriented Design & Programming



Object-Oriented Design and Programming


C++ Basic Examples
Bounded Stack Example
Linked List Stack Example
UNIX File ADT Example
Speci cation for a String ADT
String Class ADT Example
Circular Queue Class Example
Matrix Class Example, 
Bounded Stack Example
The following program implements a bounded
stack abstraction
{ This is the solution to the rst programming
assignment
e.g.,
/* The stack consists of ELEMENT TYPEs. */
typedef int ELEMENT TYPE;
class Stack f
private:
/* Bottom and maximum size of the stack. */
enum fBOTTOM = 0, SIZE = 100g;
/* Keeps track of the current top of stack. */
int stack top;
/* Holds the stack's contents. */
ELEMENT TYPE stack[SIZE];
2
Bounded Stack Example (cont'd)
/* The public section. */
public:
/* Initialize a new stack so that it is empty. */
Stack (void);
/* Copy constructor */
Stack (const Stack &s);
/* Assignment operator */
Stack &operator= (const Stack &s);
/* Perform actions when stack is destroyed. */
~Stack (void);
/* Place a new item on top of the stack
Does not check if the stack is full. */
void push (ELEMENT TYPE new item);
/* Remove and return the top stack item
Does not check if stack is empty. */
ELEMENT TYPE pop (void);
/* Return top stack item without removing it
Does not check if stack is empty. */
ELEMENT TYPE top (void);
/* Returns 1 if the stack is empty,
otherwise returns 0. */
int is empty (void);
/* Returns 1 if stack full, else returns 0. */
int is full (void);
g;


String Class ADT Example
/* Check whether String S is a substring
in this String. Return ??1 if it is not, oth-
erwise return the index position where the
substring begins. */
int String:: nd (const String &s) const f
char rstc = s[0]; // s.operator[] (0);
int end index = this->len ?? s.len + 1;
for (int i = 0;
i < end index
&& ((*this)[i] != rstc jj
memcmp (&this->str[i] + 1, s.str + 1, s.len ?? 1) !
i++)
;
return i < end index ? i : ??1;
g
/* Extract a substring from this String of
size count starting at index pos. */
String String::substr (int index pos, int count) const f
if (index pos < 0 jj index pos + count > this->len)
return "";
else f
String tmp (count);
for (int i = 0; i < count; i++)
tmp[i] = (*this)[index pos++];
/* tmp.operator[] (i) =
this->operator[] (index pos++); */
return tmp;
g
g

Read more ...