Koti Syamala

Koti Syamala

Web Services for Remote Portlet (WSRP)

The WSRP is a specification.it is used to define a portlet’s operations to remote containers. JSR 286 portlets and WSRP may be used together to define a portlet and to provide remote operations. Similarly, .NET portlets may be created for…

One day Bob is playing Zombie World video game. In Zombie World game each round will contain N zombie’s and each zombie’s energy is Zi (where 1<=i<=N). Bob will start the round with B energy. In order to move to the next level Bob need to kill all the N zombie's but Bob can select any one among N Zombie's. If energy of Bob (B) is less than Zombie energy (Zi) then Bob will die and lose the round else Bob will won, during the fighting with zombie, Bob will lose his energy by (Zi%2)+(Zi/2). At any point of game Bob will play optimally. Now your task is to find out whether Bob can reach to the next level or not.

Input Format: First line will contains B and N, separated by space, where B is the energy of Bob and N is the number of Zombie. Next line will contain N spaced integers each will represent the energy of zombie. Line 1 B N, where B is the energy of Bob and N…

Write a Java program that checks whether a given string is a palindrome or not. Ex: MADAM is a palindrome.

//Program to check whether the given string is palindrome or not import java.util.*; class Palindrome {             public static void main(String args[])             {                         String str;                         int flag=0;                         Scanner scr=new Scanner(System.in);                         System.out.println(“nEnter any String:”);                         str=scr.next();…

Write a java program to create an abstract class named Shape that contains an empty method named numberofSides ( ).Provide three classes named Trapezoid, Triangle and Hexagon such that each one of the classes extends the class Shape. Each one of the classes contains only the method numberofSides ( ) that shows the number of sides in the given geometrical figures.

  Output:   Number of sides of Trapeziod is : 4 Number of sides of Triangle is : 3   Number of sides of Hexagon is : 6

Write a java program that implements a simple/client application. That client sends data to a server. The server receives the data, Uses it to produce a result, and then sends the result back to the client. The client displays the result on the console. For ex: The data sent from the client is the radius of a circle, and the result produced by the server is the area of the circle(Use java.net)

//Program for implementing Server/Client Application // Server Program import java.io.*; import java.net.*; class Server {             public static void main(String args[])             {                         try                         {                                     ServerSocket ss=new ServerSocket(1064);                                     System.out.println(“Waiting for Client Request”);                                     Socket s=ss.accept();                                    …

Write a Program for Handling Mouse events

//Program to implement mouse events import java.awt.*; import java.awt.event.*; import java.applet.*; public class Mouseevents extends Applet implements MouseListener,MouseMotionListener {             /*<applet code=”Mouseevents” width=500 height=300></applet>*/             String msg=””;             int mousex=0,mousey=0;             public void init()             {                         addMouseListener(this);                         addMouseMotionListener(this);…

Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons for the digits and for the +, -,*, % operations. Add a text field to display the result.

//Program for implementing a Simple Calculator import java.awt.*; import java.awt.event.*; import java.applet.*; /*<applet  code=”Calculator1″ width=300 height=300></applet>*/ public class Calculator1 extends Applet implements ActionListener {             TextField t;                 Button b[]=new Button[15];             Button b1[]=new Button[6];             String op2[]={“+”,”-“,”*”,”%”,”=”,”C”};             String…

Enable Notifications OK No thanks