Write client-server classes to calculate the sum

Assignment Help Computer Networking
Reference no: EM13770516

Write client-server classes to calculate the sum of 1 + 2 + 3 + ...+ nwith rmi APIs for one client and one server. The calculation of sum must be written in a remote method in the server programs. The remote method should return the value of: sum to the client.
The client calls the remote method of servers to receive the sum. The client displays the sum on its console. Please copy/paste your java classes and interface under the word:

Below are the programs' skeleton and a sample dialog:

The client class and interface:

import java.rmi.Remote;

//This interface is complete. Do not change it.

publicinterface Project3ServerInterface extends Remote {
publicint calculateSum(int n ) throws java.rmi.RemoteException;
}
import java.rmi.*;
import java.util.*;
public class Project3Client{
//Complete this class.
}
The server classes and interface:
import java.rmi.Remote;
//This interface is complete. Do not change it.
publicinterface Project3ServerInterface extends Remote {
publicint calculateSum(int n ) throws java.rmi.RemoteException;
}
import java.rmi.*;
import java.rmi.server.*;
publicclassCalculateSumServerImplextends UnicastRemoteObject implements Project3ServerInterface {
//Complete this class.
}
import java.rmi.*;
importjava.rmi.server.*;
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
importjava.net.*;
publicclass Project3Server{
//Complete this class.
}
A sample dialog:

Display output on the server side:

RMI registry cannot be located at port 16790
RMI registry created at port 16790
Hello Server ready.

Display output on the client side:

Enter a positive integer: 5
Lookup completed
The sum is: 15
Note: The green: 5 is what the user entered.
Note: This is just a sample. Your project should work for any positive integer for n.

Reference no: EM13770516

Questions Cloud

Sales presentation for the business : "Design a short sales presentation for the business you defined for your franchise opportunity analysis. This should be no more than four slides."
Outline a financial plan for your small business : Referring to the same business you either started or purchased in the first assignment, write a 6-8 page paper in which you: Outline a financial plan for your small business.
Research cases of lawsuits related to water damage : Research cases of lawsuits related to water damage on a building project due to leaks, Who were the related parties - owner, architect, contractor , sub, other
Maintaining terrestrial and atmospheric resources : As Newly elected Mayor of Sparksville, the town's citizens are eager to hear what you plan on doing to promote the local economy while maintaining a high level of environmental air quality.
Write client-server classes to calculate the sum : Write client-server classes to calculate the sum of 1 + 2 + 3 + ...+ nwith rmi APIs for one client and one server. The calculation of sum must be written in a remote method in the server programs.
Determine of chance probability and respective payoffs : Draw the decision tree - Determine of chance probability and respective payoffs.
Describe application purpose : Write a 700- to 1,050-word paper on a specific web or mobile application. Describe that application's purpose. How is it used? What changes has it brought about to its users?
Discuss some of the pros and cons of plea bargaining : Discuss some of the pros and cons of plea bargaining (and any others you might be able to think of). If it were feasible within our system, would you support a ban on plea bargains
Define a trade deficit and a trade surplus : Define a trade deficit and a trade surplus. What are the implications of a long-term trade deficit or trade surplus? What techniques are available to correct balance of payment deficit or surplus?

Reviews

Write a Review

Computer Networking Questions & Answers

  Based on the kercher 2009 article how can management tools

q1. based on the kercher 2009 article how can management tools for microsoft windows server 2008 automate user account

  What is the size of data in the ipv4 datagram

An IPv4 header bytes in Hex notation is given below: 45 c0 00 38 9b 3e 00 00 ff 01 fd 3b 80 99 90 01 80 99 91 56.Answer the following questions about the header:What is the size of data in the IPv4 datagram?

  Would a packet-switched network or a circuit-switched

consider an application that transmits data at a steady rate for example the sender generates an n-bit unit of data

  Evaluate this situation in terms of how to best fine tune

situation you work for a large data processing organization. you are the network security administrator for the

  Displays within the zenmap gui scan report

What interfaces on LAN Switch 1 and LAN Switch 2 are configured with Telnet, and which interfaces are configured with SSH for remote terminal connectivity?

  What would be the utilized the best in todays industry

Which of the security enhancements do you think is the most important, and why and dDiscuss your thoughts on what would be the utilized the best in today's industry. Do you feel it is ground-breaking technology?

  Create a design for an ethernet network

You will create a design for an Ethernet network connecting four buildings in an industrial park. Hand in a picture showing your network. There will be a core switch in each building.

  Explain the benefits of twisted pair cable

Describe why you would suggest connecting all current and new client computers using twisted pair cable instead of staying with the current coax wiring structure.

  Reserved route takes over when device or connection fails

It determines new tree topology when switch or cable link failures. Reserved route takes over when device or connection fails. To aggregate ....to gather together Which is better, 10x100Mbps or 1Gbps?

  The 2 main types of communications media used for network

the 2 main types of communications media used for network connections are wired connections and wireless connections.

  Research paper on structures and classes

Write a 2 page research paper (excluding title and reference pages) on structures and classes. Explain the concepts discussed in the textbook using at least an example not included in the textbook. In addition to textbook, use two other resource..

  What is a survey

How the researchers are addressing the issue, which direction the research is going, the probable future research direction, conclusion/your comments, and references.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd