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

  Describe the predominant electronic and physical threats to

write a 200- to 300-word response to the following questionsq1. what are the predominant electronic and physical

  Benefits of authentication scheme

An example of when a failure may occur is if the clinet's MAC address is explicitly excluded in the AP/router configuration. What are the benefits of this authentication scheme?

  Explain bgp in wan between different as

You are using BGP-4 in WAN between AS1, AS2, and AS3. Explain in plain text or as BGP-4 policy statement how you would: Allow AS3 to communicate with AS1 but not allow AS2 to communicate with AS1.

  Outline the difference between an intranet and an extranet

Outline the difference between an intranet and an extranet A programmer is trying to produce an applet with the display shown in Figure 1 below such that whenever one of the checkboxes is selected the label changes to indicate correctly what has..

  Volatility plugins and ida

Describe Volatility plugins and IDA

  Develop a chart giving the minimum distribution time for

consider distributing a file of f 15 gbits to n peers. the server has an upload rate of u s 30 mbps and each peer has

  Purpose of key tag in rrsig resource record

Determine the purpose of the key tag in the RRSIG resource record.

  Define high-performance network

The company wants to upgrade to a high-performance network and has asked you to suggest considerations needed to alter its infrastructure.

  Reason why you would not install cables

Give me two reason why you would not install cables in ducts that are used to transport dust loos stock, flammable vapors or in those ducts that are used for ventilattion for cooking?

  Propose a sub-network design

Propose a sub-network design that will meet the needs of Acme Corporation.

  Choose one of the kinds of network processors like hubs

select one of the types of network processors such as hubs switches routers and gateways? what are the advantages and

  Telecommunications-networking routing algorithms

Complex routing algorithms are used to maintain routing tables. What algorithms are used, and how do they work? What are the advantages and disadvantages of each?

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