Archive for February 2009

Configuring gateway and serial Interface

Thursday, February 19, 2009 · Posted in

This is our activity for this day Feb. 19, 2009. In this network there are 5 networks on it. In order for you to connect to the Router 1 and then you have enable first the default gateway. This will only work in the Packet Tracer and not a real router. You can only use it when you are going to have your demo about networks.

Here's the code:

router>ena
router#config t
router(config)#int fa0/0
router(config-if)#ip add 172.16.1.1 255.255.255.0
router(config-if)#no shut

After this configuration and then the fa0/0 will now be in enable mode.

How to connect 1 router to another router?

- To connect the Router 1 to the Router 2 and then you have to configure first the Router 1, it is because it is the Router in which it contains the clock rate.

Code:

router(config)#int se2/0
router(config-if)#ip add 172.16.2.1 255.255.255.0
router(config-if)#clock rate 56000
router(config-if)#no shut
router(config-if)#exit
router(config)#router rip
router(config-if)#network 172.16.1.0
router(config-if)#network 172.16.2.0

you have to continue adding those network in your topology.

For other routers they are the same with this router but just remember that you don't have to put a clock rate on the serial in which it doesn't have a clock. To be sure hover first the connection and take note that you have to put the clock rate to the port in which it contains the clock symbol.

How to configuring fastethernet interface

Tuesday, February 17, 2009 · Posted in

If you want to demonstrate on how to configure a router in the Packet Tracer and then you can configure the router through its CLI or the Command Line Interface. Here are some image that can help you.


In this topology there are 4 networks that you can see which is the network 192.168.201.0, 192.168.202.0, 192.168.203.0, 192.168.204.0. This are the 4 networks in the topology.

1st if you want to enable your default gateway on network 192.168.201.0 and then you have to configure first the FastEthernet in Router1.

Here are some of the code:

router>ena // it allows you to enter the privileged mode
router#config t //it is short for configure terminal
router(config)#int fa0/0 // this allow you to configure the fastethernet
router(config-if)#ip add 192.168.201.1 255.255.255.0 // it allows you to enter the ip add

For the serial to be followed......

How to get the Factorial by Using Recursion

Sunday, February 15, 2009 · Posted in

This is an example or recursion in which there is a function inside a function here are the codes and the ouput:

Output:

Codes:


#include<.....>
#include<......>
#include<......>
using namespace std;
int factorial(int num)
{
if(num==0)
return 1;
else
return num*factorial(num-1);
}

int main()
{int z;int num;
menu:system("cls");
cout<<"Enter number: ";
cin>>num;
z=factorial(num);
cout<<<"";
cout<<"\n\n";
system("pause");
system("cls");
goto menu;
getch();
}

How to create hover button without javascript

· Posted in

In this example it illustrates on how to create a hover menu without using a javascript but only pure css.

Output:

CSS:

div
{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
text-decoration:none;
color:#000000;
list-style:none;
}

td
{
background-image:url(banner2.jpg);
width:150px;
left: 14px;
top: 0px;
text-align:center;

}
a:hover div
{
color:#FFFFFF;
opacity:.2;
background-color: #0000FF;
}

How to get the average of 2 Numbers using function

Friday, February 13, 2009 · Posted in

If you have some problem in C++ or either in C adding numbers and getting its average by using a function and then I have some codes here that can really help you a lot.


Output:

Code:





#include<......>

#include<......>
#include<......>
#define p printf

float ave(float x, float y);
int add(int x, int y)
{
int sum=0;

sum=x+y;

return sum;
}
int main()
{
menu:
system("cls");
int a,b;

p("Enter Num1: ");
scanf("%d", &a);
p("Enter Num2: ");
scanf("%d", &b);
p("\n\nThe sum of the two integers is %d.",add(a,b));
p("\n\nThe average of the two integers is %.1f.",ave(a,b));
p("\n\n");
system("pause");
char choice;
p("\nDo you want to repeat the process?[y for yes][n for no]: ");
scanf("%s", &choice);


if(choice=='y'||choice=='Y')

goto menu;

else if(choice=='n'||choice=='N')
exit(0);


getch();

}

float ave(float x, float y)
{
float ave,sum;
sum=x+y;
ave=sum/2;

return ave;

}

How to add 2 numbers using function

· Posted in

If you have some problem in C++ or either in C adding numbers by using a function and then I have some codes here that can really help you a lot.


Output:



Code:





#include<'stdio.h'>

#include<'conio.h'>
#include<'stdlib.h'>
#define p printf

int add(int x, int y)
{
int sum=0;

sum=x+y;

return sum;
}
int main()
{
menu:
system("cls");
int a,b;

p("Enter Num1: ");
scanf("%d", &a);
p("Enter Num2: ");
scanf("%d", &b);
p("\n\nThe sum of the two integers is %d.",add(a,b));
p("\n\n");
system("pause");
char choice;
p("\nDo you want to repeat the process?[y for yes][n for no]: ");
scanf("%s", &choice);


if(choice=='y'||choice=='Y')

goto menu;

else if(choice=='n'||choice=='N')
exit(0);


getch();

}

Powered by Blogger.