Sorting number based on the weight

/**************************************************************************** Given a set of numbers like <10, 36, 54,89,12> we want to find sum of weights based on the following conditions 1. 5 if a perfect square 2. 4 if multiple of 4 and divisible by 6 3. 3 if even number And sort the numbers based on the weight and print it as…

Pattern Printing 2

input:program output: P         M R      A O  R G O    R R       A P          M Program:   #include <stdio.h> #include<string.h> int main() { int n,k; char* ar=”program”; n=strlen(ar); for (int i = 0,k=n-1; i <n; i++,k–) { for (int j = 0; j < n; j++){ if((j==i) || (j==k)){ printf(“%c”,ar[i]); } else{ printf(” “); }…

Pattern Printing

Input:3 Output: 33333 32223 32123 32223 33333 Java Program  public class MyClass { public static void printMatrix(int N) {   for(int i = 0; i < 2 * N – 1; i++) { for(int j = 0; j < 2 * N – 1; j++) { System.out.print(1+Math.max(Math.abs(N-i-1), Math.abs(N-j-1)) ); } System.out.println(); } }    public…

Wireless Communication previous year questions

BE-IT-5-EC6801-DEC-2016 BTECH-IT-5-EC6801-DEC-2015 BTECH-IT-5-EC6801-JUNE-2016 EC2401 wireless may 2013 EC2401 wireless nov 2011 EC2401_WC_NOV.DEC2014_REJINPAUL_QUESTIONPAPER EC20401_WC_REJINPAUL_MAY_JUNE_2015_QP WC DEC13 R8 rejinpaul.com WC June14 R8 rejinpaul.com WC Nov 2012 QP

Chat

Server.java package cn; import java.net.*; import java.io.*; class Cserver { public static void main(String ar[])throws IOException { byte buf[]=new byte[1024]; DatagramSocket sc = new DatagramSocket(789); BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in)); InetAddress ia=InetAddress.getLocalHost(); while(true){ DatagramPacket p=new DatagramPacket(buf,buf.length); sc.receive(p); String d=new String(p.getData(),0,p.getLength()); System.out.println(“Client: ” + d); System.out.println(“Server: “); String s=br1.readLine(); if(s.equals(“end”)) break; buf=s.getBytes(); sc.send(new DatagramPacket(buf,s.length(),ia,790)); }…

Echo Client and Server

  Server.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package cn; import java.net.*; import java.io.*; class Eserver { public static void main(String ar[])throws IOException { byte buf[]=new byte[1024]; DatagramSocket sc…

RPC implementation in java

  1.Create a interface ucet and declare functions ucet.java import java.rmi.*; public interface ucet extends Remote { public String hello(String na) throws RemoteException; public int age(int num) throws RemoteException; } 2.Create a class rpc which has function definition of the functions declared in ucet class rpc.java import java.rmi.*; import java.lang.Math.*; import java.rmi.server.*; public class rpc…

RARP protocol implementation in java

RARP means Reverse Address Resolution Protocol. It maps the physical address to logical address. Cn.java – //Server program 1.Create a socket.Bind with port number 2.Store mac address in a array and ip address in a array 3.Read the data from user and check with mac address array if match found send corresponding ip address value…

JDBC Connection in java using mysql

Program to insert data from user into the table /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package database1; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;…

Simple user identification system using JSP and mysql

1.Open a new web application project  in Netbeans. Delete the default index.html 2.Insert this code in index.jsp   <%– Document : index.jsp Created on : 30 Aug, 2017, 7:39:09 PM Author : shobana –%> <%@page contentType=”text/html” pageEncoding=”UTF-8″%> <!DOCTYPE html> <html> <head> <link rel=”stylesheet” href=”bootstrap.css”> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″> <title>Login form</title> <style> body{ background-image: url(“bg.jpg”); color:white;…