Posts

Showing posts from April, 2024

LP 5

 TOKEN RING  import java . util . Scanner ; public class TokenRing {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );         System . out . println ( "Enter number of nodes you want :" );         int n = sc . nextInt ();         System . out . println ( "Ring formed is as below :" );         for ( int i = 0 ; i < n ; i ++ ) {             System . out . println ( i );         }         System . out . println ( "0" );         int choice = 1 ;         int token = 0 ;         do {             System . out . println ( " \n Enter Sender :" );             int sender = sc . nextInt ();       ...

LP 1

 CLIENT import java . rmi .* ; import java . util .* ; public class client {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );         try {             String serverURL = "rmi://localhost/server" ;             serverinterface Serverinterface = ( serverinterface ) Naming . lookup ( serverURL );               System . out . println ( "Enter first Number :" );             double num1 = sc . nextDouble ();             System . out . println ( "Enter 2nd number:" );             double num2 = sc . nextDouble ();               System . out . println ( "Fisrt Number is :" + num1 );             System . out . println ( "Fisr...