Draw out a uml class diagram, JAVA Programming

Assignment Help:

Question:

(a) Draw out a UML class diagram that captures the following information: An Employee is a kind of Person. An ATM is a kind of Machine. Both an Employee and an ATM can behave as if they were a Cashier, in that it is possible to both withdraw cash from them and deposit cash with them.

(b) Now consider the Person class and the Cashier interface listed below. Write the Java code for an implementation of the Employee class of part 1(a). Do not complete the body of any methods in the Employee class - just place comments to outline the actions that should occur:

public class Person {
public int age;
public int secId_number;
}

public interface Cashier {
public void withdraw(int account_id, int amount);
public void deposit(int account_id, int amount);
}

(c) The Java class for Person in part 1(b) does not illustrate best practice in Java programming.

i. Modify the Person class to make it robust so that it is not possible for negative values of the fields of an instance of Person to be set.

ii. Define a constructor for the Person class that enables an instance to be created with specific age and secId_number values.

iii. Define a constructor for the Employee class that also enables specific age and secId_number values to be set.

iv. What is the difference between declaring a field private and declaring it protected?


Related Discussions:- Draw out a uml class diagram

Functions of specific codes, Please can you write some codes and their func...

Please can you write some codes and their functions too. At least 10! Please

Java program to play minesweeper , Project Requirements Write and tes...

Project Requirements Write and test a Java program to play Minesweeper using Model-View-Presenter design (The model is an interface defining the data to be displayed or other

Write a java client by using arraylists, 1. The purpose of this problem is ...

1. The purpose of this problem is to practice using ArrayLists.Write a Java client file containing a mainmethod plus other methods as needed to solve the following problem (no clas

Explain the user defined exceptions, Explain the user defined Exceptions. ...

Explain the user defined Exceptions. User Defined Exceptions are the exceptions which are defined by user for specific purposed. This enables custom exceptions to be generated

Program, write a program in java which enters name,roll #,and shows the sum...

write a program in java which enters name,roll #,and shows the sum of students english and maths marks?

Write an application for a video store, Do you provides a Complete source C...

Do you provides a Complete source Codes for this application: " a. Write an application for a video store. Place the names of 10 of your favorite movies in a combo box. Let the use

Banking database system - java database connectivity, JDBC Assignment B...

JDBC Assignment Banking Database System:  BankCustomer CUST_ID  CUST_NAME ADDRESS ACC_TYPE CUST_ID

Difference b/w software platform and java platform, Java platform is a soft...

Java platform is a software-only platform independent, which runs on top of other hardware-based platforms like WINDOWS, UNIX, NT etc.   The Java platform has 2 main com

Need to develop chat application for j2me, Need to develop Chat application...

Need to develop Chat application for j2me and I want Image Processing code Project Description: We want a chat application for a community website. Image processing and co

Visa resolve online - websphere administrator, Visa Resolve Online and Heal...

Visa Resolve Online and Health Care Project: Visa Resolve Online In this project there are few modules like TRANSACTION INQUIRY,CHARGEBACK , REPRESENTMENT, ARBITRATION .

Write Your Message!

Captcha
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