Tuesday, February 8, 2011

CrazyEngineers Forum - Computer Science & IT Engineering

CrazyEngineers Forum - Computer Science & IT Engineering


Doubt on Network Layer

Posted: 07 Feb 2011 10:14 PM PST

I read the below statements(quoted) in some forum and I believe this is true

"Ip address(network address) is just use for transfering informatiom from one network to an other.travelling of information among networks uses ip addresses.

Mac addresses(physical addresses) is actually uses for distrubution of information.so the summay is:-

1) carring of information from one network to another.
2) distrubtion of information(resources) is based upon mac address.

example:-
Network A Network B and Network C are three networks.all network are having 5 nodes(client).if i want to send information to node 3 for network B.

Solution:-
1) first i send infomation to network by the help of IP address of that network(Network B).Ip addresses are unique on network layer(this is the fact).

2)after that it will send infomation to node 3 of network B by the help of mac address which is unique at layer 2(DLL)."

But I have some doubts in this.

1)Do we need network layer to transfer data inside a LAN ?

2)In the solution part of above statements, do we(sending machine) need to know the ip address of both network B and the node (of network B) ? If we don't need to know the ip address of node in network B, how will the router in network B know that it is for that particular client ?

3) After the packet reaches the destination Network B, it is said that "it will send infomation to node 3 of network B by the help of mac address which is unique at layer 2" how does the router(of network B) know the mac address of that node ? does it use rarp ? or does it have a table ?

Airline reservatoin system

Posted: 07 Feb 2011 06:24 PM PST

I m asked to perform bookin through credit system.i am done with basic things like login,signup ,flight details.but i dont to proceed after this i.e once booking is done by the passenger,his name should go to the flight database...pls help me out guys in preparing the reservation module....here i m posting the code that i ve done so far...

Code:


/
import java.io.*;
public class Passenger
{
    // instance variables - replace the example below with your own
    public String Pname;
    public String MailId;
    public String Address;
    public String username;
    public String pwd;

   

    /**
    * Constructor for objects of class Passenger
    */
    public Passenger(String Pname,String MailId,String Address,String username,String pwd)
    {
        // initialise instance variables
        this.Pname = Pname;
        this.MailId = MailId;
        this.Address = Address;
        this.username = username;
        this.pwd = pwd;
     
       
    }
}
   
       
class sample
{
    public static void main(String a[])
    {
       
        Passenger p1 = new Passenger("Vignesh","abcd@yahoo.in","11/5 parthasarathy puram","vicky","xyz123");
        Passenger p2 = new Passenger("Ramesh","efgh@yahoo.in","22/5 parthasarathy puram","rams","fast");
        Passenger p3 = new Passenger("Dinesh","ijkl@yahoo.in","33/5 parthasarathy puram","dinu","pwd12");
        Passenger p4 = new Passenger("Rahul","mnop@yahoo.in","44/5 parthasarathy puram","rahulcool","007bond");
        Passenger p5 = new Passenger("Saravana","ghij@yahoo.in","55/5 parthasarathy puram","sarah","sarav");
        int point=0;
        String usernm[] = {"Vignesh","Rahul","Dinesh","Saravana","Ramesh"};
        int size=usernm.length;
        int points[]={2000,3000,4500,6000,10000};
        int size1=points.length;
        for(int i=0;i<5;i++)
        {
          if(p1.Pname==usernm[i])
          {
            System.out.println("User" + "\t" +usernm[i]+ "\t" +"is having"+"\t" +points[i]);
          }
        }   
         
        for(int i=0;i<5;i++)
        {
          if(p2.Pname==usernm[i])
          {
     
            //point =points[i];
            System.out.println("User"+"\t" +usernm[i]+"\t"+ "is having"+"\t" +points[i]);
        }
        }     
       
       
        for(int i=0;i<5;i++){
          if(p3.Pname==usernm[i])
          {
         
          // point =points[i];
          System.out.println("User"+"\t" +usernm[i]+"\t"+ "is having"+"\t" +points[i]);
        }
        }
         
 
        for(int i=0;i<5;i++)
        {
          if(p4.Pname==usernm[i])
          {
         
          // point =points[i];
          System.out.println("User"+"\t" +usernm[i]+"\t"+"is having"+"\t" +points[i]);
          }
        }
          for(int i=0;i<5;i++)
        {
          if(p5.Pname==usernm[i])
          {
         
          // point =points[i];
          System.out.println("User"+"\t" +usernm[i]+"\t"+"is having"+"\t" +points[i]);
        }
        }
        Flight f =new Flight();
        f.display();
        Booking b = new Booking();
        b.reservation();
       

    }
     
    }


class Flight
{
  int FlightNumber[]={1,2,3,4};
  String Source[]= {"India","China","India","London"};
  String Destination[]= {"U.S","India","U.K","U.S"};
  String DepartureTime[]= {"3.00A.M","11.00P.M","11.30P.M","7.00P.M"};
  String ArrivalTime[]= {"1.00P.M","3.00A.M","2.30A.M","4.00A.M"};
  int Miles[]={8000,9000,8500,10000};
  int Seats[]={15,20,25,20};
 
  void display()
  {
    for(int i=0;i<4;i++)
    {
      System.out.print(""+FlightNumber[i]+"\t"+Source[i]+"\t"+Destination[i]+"\t"+DepartureTime[i]+"\t"+ArrivalTime[i]+"\t"+Miles[i]+"\t"+Seats[i]+"\n");
           
    }
      }
}

 
 
  class Booking extends Flight
  {
    int distance = 0;
    double cost = 0.0;
    int choice;
    Flight f = new Flight();
   
    void reservation()
    {         
    System.out.println("Select your choice");
    System.out.println("1-----> India -U .S");
    System.out.println("2-----> China - India");
    System.out.println("3-----> India - U .K");
    System.out.println("4-----> London - U .S");
 
    try
    {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int choice = Integer.parseInt(br.readLine());
      switch(choice)
      {
        case 1:
        {
          for(int i=0;i<4;i++)
          {
          if(f.Source[i]== "India" && f.Destination[i]== "U.S")
          {
            distance = Miles[i];
            cost =(0.1*distance) + distance;
            System.out.println("Trip cost = " + cost);
            System.out.println("Available seats = "+Seats[i]);
            System.out.flush();
            System.out.println("Nmber of seats required:" );
            int sno = Integer.parseInt(br.readLine());
            System.out.println("Available seats:"+(Seats[i] - sno));
                                           
                       
          }
          }
          break;
        }
       
        case 2:
        {
          for(int i=0;i<4;i++)
          {
          if(f.Source[i]== "China" && f.Destination[i]== "India")
          {
          distance = Miles[i];
          cost =(0.1*distance) + distance;
            System.out.println("Trip cost = " + cost);
            System.out.println("Available seats = "+Seats[i]);
            System.out.flush();
            System.out.println("Nmber of seats required:" );
            int sno = Integer.parseInt(br.readLine());
            System.out.println("Available seats:"+(Seats[i] - sno));
                                           
          }
          }
          break;
        }
   
        case 3:
        { for(int i=0;i<4;i++)
      {
          if(f.Source[i]== "India" && f.Destination[i]== "U.K")
          {
            distance = Miles[i];
            cost =(0.1*distance) + distance;
            System.out.println("Trip cost = " + cost);
          System.out.println("Available seats = "+Seats[i]);
          System.out.flush();
            System.out.println("Nmber of seats required:" );
            int sno = Integer.parseInt(br.readLine());
            System.out.println("Available seats:"+(Seats[i] - sno));
                                           
          }
        }
        break;
        }
       
        case 4:
        {
          for(int i=0;i<4;i++)
          {
            if(f.Source[i]== "London" && f.Destination[i]== "U.S")
          {
            distance = Miles[i];
            cost =(0.1*distance) + distance;
            System.out.println("Trip cost = " + cost);
            System.out.println("Available seats = "+Seats[i]);
            System.out.flush();
            System.out.println("Nmber of seats required:" );
            int sno = Integer.parseInt(br.readLine());
            System.out.println("Available seats:"+(Seats[i] - sno));
                                           
          }
        }
          break;
      }
      }}
         
        catch(Exception e)
        {
         
          System.out.println("I/O Error");
        }
    }

  }

Research project, Cloud Computing, who would use it and why? Anyone have experience?

Posted: 07 Feb 2011 09:02 AM PST

Hey guys, I have been researching cloud computing and collecting academic papers on this topic as I myself need to write a paper on a subject of my choice. I chose Cloud Computing, because I feel it was something that interested me, although at that point I didn't exactly know what it was, I still don't probably. The thing is, I have never spoke to or met anyone who has used it or knows anyone who has. While researching this subject I came across all sorts of information and jargon, and in the academic papers I have been reading I saw the EC2 mentioned a lot. So what type of business would need to use Amazons Web Services? And what is wrong with just installing the software onto their own machines? As I know that cloud computing is not just hosting it is also applications based.

I saw a post recently here and have bookmarked the links provided from the posters helping out, so thanks for those, I will read them after I post this.

The reason I am asking you guys this question is, through all my research, I am left feeling that cloud computing is contradictive and without any easy explanation. The youTube videos, demonstrate what cloud computing does but I'd like to see an real life example of it being used! Does a business have an account and log in and accesses everything form the clouds server? I was reading the information on Amazons web site for EC2 but I don't have time to read it all and it may not provide me with the information which I seek.

I know there are a lot of computer experts here and I am hoping someone can take the time to answer my questions, I appreciate all of your time and efforts!

Thanks

to develop LAN administrator tool

Posted: 07 Feb 2011 05:43 AM PST

can neone help in on this.. i need to know the required technologies nd also the interfacing issues... looking forward to replies dat may help me:smile:

No comments:

Post a Comment