Thursday, July 21, 2011

Basic Structure Of C++

1. Structure Of Program 
declaration header file / preprocessor
begins with the # include <header name file>
constant declarations (optional)
global variable declaration (optional)
function declaration (optional)
declaration of class (optional)

The main program (main function)
main () {
     ... ....
     ... ... ..
}

2. Defining header
 Header is a function that supports the execution specific instructions in C + +

Some headers are often used:
iostream.h for instructions on court and cin
conio.h for instruction getch () and clrscr ()

stdio.h for instruction gets ()

3. Things to note 

a. Instruction to move the cursor on the following lines:
" \n "
<<endl;

b. Write a comment:
/ /
If only one line comment
/*.....*/
Very useful if more than one line comment.
 

c. C + + is case sensitive distinguish uppercase and lowercase letters, so that:
instructions should be written in lowercase
example:
court <<correct
Court <<incorrect
Variables are written with lowercase and uppercase letters are different.
example:
Variable 'X' will be distinguished by the variable 'x'
The variable 'number' will be distinguished by the variable 'Numbers'
 

Comments on Java

Comments on Java
Comments are notes written at code for the purpose of documentation materials. This text is not part of the program and did not affect the course of the program.
Java supports three types of comments: C + + style single line comments, C style multiple lines, and special javadoc comments
 
1. Writing Comments in C + +
C + + style comments begin with / /. All text after / / is considered as a comment. For instance,
/ / This is a C + + style or single line comments
 
2. Writing comments on C
C-style comments or also called the comment a few lines begin with / * and end with * /. All text that is between two marks is considered a comment. Unlike C + + style comments, it can reach a few lines. For example,
/ * This is an exmaple of a
C style comments or multiline * /
 
3. Special comments javadoc
Special Javadoc comments are used to generatisasi HTML documentation for your Java program. You can create a javadoc comment lines begin with / ** and end with * /. Like comments C_style, it can also reach out to a few lines. It can also be composed of the tags to add more information on your comment. For example,
/ **
This is an example of special java doc comments used for \ n
generating the html documentation. It uses tags like:
@ author Florence Balagtas
@ version 1.2
* /

Basic Of Java

we will try to analyze your first java program:
public class Hello
{
/ **
* My first java program
* /
public static void main (String [] args) {
/ / display the string "Hello world" on screen
System.out.println ("Hello world!");
}
}


public class Helloindicate the class name is Hello. In java all the code should be placed inside the class declaration. We do this by using the keyword class. In addition, the class uses a special public access, which indicates that our class will have free access to another class from another package anyway (package is a collection of classes). We will discuss more deeply about the package and special access to a further discussion.The next line is composed of curly braces {indicates the beginning of the block. In this code, we put the brace on the next line after the declaration of class, however, we can also put a brace after the first line of code we write. So, we can write our code as follows:public class Hello{orpublic class Hello {The next three lines indicate a comment in the java language. Comment is something that is used to document each section of code written. Comments are not part of the program itself, but it is used for documentation purposes. The comments themselves can be added to the code you write as a guide that can help the process of learning good programming./ *** My first java program* /Comments are indicated by the sign "/ *" and "*/". Everything that exists between these markers is ignored by the java compiler, and they are only considered as a comment.The next line,public static void main (String [] args) {or can also be written as follows,public static void main (String [] args){indicate the name of a method in a class in acting as the main method. The main method is the starting point of a Java program. All proram except applet written in Java language starting with the main method. Be sure to
The next line is also a commentary,/ / Prints the string "Hello world" on screenNow we learn two ways to make a comment. The first way is by placing a comment in / * and * /, and another way is to write the sign / / at the beginning of the commentsThe next line,System.out.print ("Hello world!");displays the text "Hello World!" on the screen. Command System.out.println (), displays a text enclosed by double Pute marks ("") on the screen.The last two lines consisting of two brackets used to close the main method and each class in sequence.

Topology

 Network Topology


According to Dede Sopandi in his book on computer networks (2008: 27-32) Network topology is the arrangement or mapping of interconnection between nodes, from a network, both physical (real) and logical (virtual). Topology describes the methods used to perform physically pengabelan from a network.

Physical topology network is the means used to connect workstations in the LAN. Various kinds of physical network topology, among others: 

1. Bus Topology or Linear  
Bus topology is a topology widely used in the mushrooming use of coaxial cable. The characteristics of this topology is one cable with both ends closed along the cable where there are nodes, most prevevalent because it is simple in its installation, the cable signal through two-way and possible collision. 

2. Ring topology 
Ring topology is the topology information and data as well as the traffic is channeled in such a way. Generally these facilities utilize optical fiber as the ingredients. The characteristics of this topology is a closed loop that contains nodes, simple in layout, signal flow in one direction and thus avoid the collision.

3. Star topology

Star topology is a topology that is widely used in various places, because of the ease to add, subtract, or detect any tissue damage. The characteristics of this topology each node communicates directly with the central node, the data traffic flowing from node to node and back again central, easy to develop because each node only has a cable directly connected to the central node, edge node if one cable is disconnected then the others will not disturbed.

4. topology tree

Tree topology is the topology of the network where the topology is a combination or combinations of these three topologies are the star topology, ring topology and bus topology.

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Best Web Hosting