Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Assignment

Question 1:

In a client-server system for a hypothetical banking application, the clients are ATM machines, and the server is the bank server. Suppose that the client has two operations: withdraw and deposit. Use the broker architectural pattern to document an initial architecture design for this system:

1- Draw a class diagram for this system. Use a client-side proxy to encrypt the data using an encrypt operation, and use a server side proxy to decrypt the data.

2- Draw a sequence diagram for this system.

3- Suppose that we want greater availability of the server, discuss what kind of tactics you should use to achieve that.

Question 2:

You are given a class that processes the purchases for an online store. The class receives calls to retrieve the prices for items from a database, records the sold items, updates the database, and refreshes the webpage. What architectural pattern is suitable for this? Illustrate your answer by drawing a model for the solution, showing the method calls/events. Comment on how applying the pattern will impact the modifiability of the system.

Question 3:

A "Personal Address Book" application program allows the user to add, delete, search, save and load her contact information. The program separates user (command-line) interface and internal processing subsystem. The internal processing system consists of the following classes: ContactManager (responsible for add and delete operations), ContactFinder (responsible for search operation), and DataManager (responsible for save and load operations).

1- What design pattern can be used to implement the user interface? Explain your answer using class diagram for the entire system.

2- Draw an UML sequence diagram to show the behavioural view of the personal address book program that demonstrates what happens when a user enter a new contact information.

Question 4:

In a system comprising of 3 components: A, B, C. Calling A requires calling B, and calling B requires calling A. Component C is responsible for tasks T 1, T 2, and T 3.

Comment on the modifiability of this system. What are the problems that you see in this system, and how you solve them?

Suppose that T 1 is performed by both component A and C? What does it say about A and C? How you solve this problem?

Question 5:

Write a performance scenario for the Trent Course Registration System. Suppose that this system uses a client-server architecture. Think about whether your major concern is latency, throughput, or some other response measure. What tactics you will use to mitigate these issues. Elaborate your answer using examples.

Question 6:

1451_Layered_System.jpg

Show how you will do the integration testing on the above layered system using bing bang, top- down, bottom up, sandwich and modified sandwich approaches?

Question 7:

Write JUnit test cases for setLoanAmount (to test the Exception) and getMonthlyPayment.

public class Loan {
private double annualInterestRate; private int numberOfYears;
private double loanAmount; private java.util.Date loanDate;

/** Default constructor */ public Loan() {
this(2.5, 1, 1000);
}

/** Construct a loan with specified annual interest rate, number of years, and loan amount
*/
public Loan(double annualInterestRate, int numberOfYears, double loanAmount) {
this.annualInterestRate = annualInterestRate; this.numberOfYears = numberOfYears; this.loanAmount = loanAmount;
loanDate = new java.util.Date();
}

/** Return annualInterestRate */
public double getAnnualInterestRate() { return annualInterestRate;
}

/** Set a new annualInterestRate */
public void setAnnualInterestRate(double annualInterestRate) { this.annualInterestRate = annualInterestRate;
}

/** Return numberOfYears */ public int getNumberOfYears() {
return numberOfYears;
}

/** Set a new numberOfYears */
public void setNumberOfYears(int numberOfYears) { this.numberOfYears = numberOfYears;
}

/** Return loanAmount */
public double getLoanAmount() { return loanAmount;
}

/** Set a newloanAmount */
public void setLoanAmount(double loanAmount) throws Exception{ if (loanAmount < 0)
throw new Exception("Money cannot be negative"); this.loanAmount = loanAmount;
}

/** Find monthly payment */
public double getMonthlyPayment() {
double monthlyInterestRate = annualInterestRate / 1200;
double monthlyPayment = loanAmount * monthlyInterestRate / (1 - (1 / Math.pow(1 + monthlyInterestRate, numberOfYears * 12)));
return monthlyPayment;
}

/** Find total payment */
public double getTotalPayment() {
double totalPayment = getMonthlyPayment() * numberOfYears * 12; return totalPayment;
}

/** Return loan date */
public java.util.Date getLoanDate() { return loanDate;
}
}

Submit your: 1-Source code.
2-Screenshots of the test runs.

For all diagrams, use an appropriate modelling tool such as Microsoft Visio. Submit your assignment on blackboard using a pdf file.

Java, Programming

  • Category:- Java
  • Reference No.:- M92261865

Have any Question?


Related Questions in Java

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As