essay代写,代写assignment,paper代写,代写留学作业,英国作业

导航切换

QQ:
153688106

二维码

澳洲assignment代写:COSC1284 Pro

浏览: 日期:2020-01-13

  澳洲大学2019年第二学期编程技术学期COSC1284 Programming Techniques Assignment

  背景资料对于此分配,您需要使用Java编程语言编写一个面向对象的控制台应用程序,该应用程序遵循如下所示的基本的面向对象的编程原理:

  a)您的代码应遵循良好的面向对象原则,例如:封装,组合,内聚。

  b)将所有实例变量的可见性设置为私有。

  c)仅在需要并适当考虑范围(可见性)的情况下使用getter和setter方法。

  d)仅在有充分理由时才使用静态属性和方法,例如在保持良好的面向对象设计的同时减少代码重复。

  e)使用超类方法从子类方法中检索和/或操纵超类属性。 避免直接访问类属性。

  f)对已创建的对象调用方法时,应尽可能利用多态,并避免不必要的转换。

  商业规则:除了规范中详述的特定于类别的业务规则之外,每个类别还必须实现以下业务规则。无法为属性分配空字符串,而应分配“ N / A”。任何被认为无效的数值都应分配为-1。您必须确保通过以下方式考虑对空值的适当保护:防止属性具有空值和/或在对对象执行操作之前检查空值的存在。数组的大小和大小应适当调整,以确保它们足够大以容纳数组容纳的项目数。代表单个对象的所有类都必须实现“ getDetails”和“ toString”方法,以提供对象状态的字符串表示形式。

  Overview

  The staff at MiBay want you to build a program that will allow them to manage the creation and delivery of packages of goods.

  A user will be able to: • Search for packages by delivery date.

  • Display deliveries sorted in order of the customer surname.

  您将通过实现一系列旨在满足这些需求的类来满足这些要求。 必须根据面向对象的原则设计类。

  Assignment 2 – Getting Started

  This assignment is divided up into several stages, each of which corresponds to the concepts discussed during the course as shown below: • Stage 1 - Package & associated classes

  • Stage 2 MiBay System

  • Stage 3 - Exception Handling

  • Stage 4 - Persistence to fileThe assignment is designed to increase in complexity with earlier stages being easy and the later stages being more difficult. In addition, the specification will be more prescriptive in the earlier stages. The later stages of the assignment are less prescriptive and will require you to be more independent and resolve design issues on your own.

  You are not permitted to use streams from Java 1.8.

  You must use an array to store any collections of data in your program.

  You must not use ArrayLists, Maps or any other data structures within the Java API or from 3rd party libraries.

  Failing to comply with these restrictions will incur a 50% marking penalty.

  免责声明:尽管所描述的方案是基于包裹递送服务的概念的,但是此任务的规范旨在表示这种系统的简化版本,并且并不意味着对任何此类包裹递送服务进行逐字模拟。

  Stage 1 - Package Hierarchy (and associated classes)

  此阶段需要实现几个类。 下面提供了一些类; 其他人则需要您根据需要创建。至少您需要创建两个名为Package和PlatinumPackage的类。您将被要求仔细考虑您在课程中学到的概念,并做出有关修改类以符合规定要求的决定。Package和PlatinumPackage类共享共同的属性和行为,因为它们都表示一个包。 但是,将存在仅属于PlatinumPackage的其他属性和行为。PlatinumPackage是“包装”。 +其他属性和方法。在面向对象的编程中,只要我们看到“是”关系,便通过实现类层次结构对其进行建模。

  A) Create a Customer and associated classes

  Your class should have the following method signature as a minimum.

  public Customer(String firstName, String lastName, Address address)

  Customer specific business rules:

  1. The customer must have a first and a last name.

  2. The customer must have at least one address.

  3. There may be up to 2 addresses. If a second address is provided it will be considered an alternate delivery address.

  You should write a test class that will FULLY test this class and its dependencies.

  Think about the following scenarios as a starting point.

  1. Valid construction

  2. Invalid construction

  • Empty Strings

  • Null values

  3. Operations

  • Setting a preferred alternate address when it does not exist

  • Adding a second alternate address

  • Setting a preferred alternate address when it does exist.

  • Adding a third address

  B) Create a Product class

  You class should have the following method signatures as a minimum. public Product(String name, double weight, double cost)

  Business Rules:

  1. The weight of the product must be greater than zero.

  2. The cost of the product must be greater than one.

  You should write a test class that will FULLY test this class.

  Think about the following scenarios as a start point.

  1. Valid construction

  2. Invalid construction

  • Empty Strings

  • Null values

  • Zero values

  C) Create Package class

  You class should have the following method signatures as a minimum.

  public Package(Customer customer, Product product)

  public boolean addProduct(Product product)

  public boolean removeProduct(Product product)

  Business Rules:

  1. There must be only one customer.

  2. There must be at least one product.

  3. Products can be added to the list of products after construction.

  4. Products are removed from the list of products based on the name of the product supplied.

  5. If more than one product has an exact match to the name supplied, only one instance of the product should be removed from the array.

  You should write a test class that will FULLY test this class.

  Think about the following scenarios as a start point.

  1. Valid construction

  2. Invalid construction

  3. Adding/Removing products

  D) Create PlatinumPackage class (sub-class of Package)You class should have the following method signatures as a minimum.

  public PlatinumPackage(Customer customer, Product product,

  String memberNumber)

  public boolean updateMemberNumber(String memberNumber) Business Rules:

  1. All the business rules that apply to the parent 'Package' class.

  2. Must have a member number.

  3. The member number must be 10 alphanumeric characters. The initial characters should be alphabetic, and the subsequent characters should alternate between alphabetical and numerical.

  For example:

  Valid Member Numbers:

  "D0B4M4S7Y5"

  "Z0W0P9J2V6"

  "F9N5S7H9Z1"

  "P5N3M1R9Z8"

  "Z0L3C8J9L8"

  "Q5G7J8F8K3"

  "H8Z9L9A4E9"

  "U8M4Z3N9F5"

  "I9X4L5A5M0"

  "X9S9V6I0Y8"

  Invalid Member Numbers:

  "D0B4M4S7Y" "D0B4M4S7Y5A" "D0BM44S7Y5" "D$B4M4S7Y5"

  (9 characters)

  (11 characters)

  (non-alternating) (non-alphanumeric)

  You should write a test class that will FULLY test this class.

  Think about the following scenarios as a start point.

  1. Valid construction

  2. Invalid construction

  3. Updating a member number

  Coding Style

  Your program should demonstrate appropriate coding style, which includes: • Formatting

  Indentation levels of 3 or 4 spaces used to indent or a single tab provided the tab space is not too large - you can set up your IDE/editor to automatically replace tabs with levels of 3 or 4 spaces.

  A new level of indentation added for each new class/method/ control structure used.

  Indentation should return to the previous level of at the end of a class/method/control structure

  (before the closing brace if one is being used). Going back to the previous level of indentation at the end of a class/method/control structure (before the closing brace if one is being used)

  Block braces should be aligned and positioned consistently in relation to the method/control structure they are opening/closing.

  Lines of code not exceeding 80 characters in length - lines which will exceed this limit are split into two or more segments where required (this is a guideline - it's ok to stray beyond this by a small amount occasionally, but try to avoid doing so by more than 5-6 characters or doing so on a consistent basis).

  Expressions are well spaced out and source is spaced out into logically related segments

  • Good Coding Conventions

  Identifiers themselves should be meaningful without being overly explicit (long) – you should avoid using abbreviations in identifiers as much as possible (an exception to this rule is a “generic” loop counter used in a for-loop).

  Use of appropriate identifiers wherever possible to improve code readability.

  All identifiers should adhere to the naming conventions discussed in the course notes such as

  ‘camel case’ for variables, and all upper case for constants etc.

  Complex expressions are assigned to meaningful variable names prior to being used to enhance code readability and debugging.