首页 » Java代写 » Java编程作业代写|COSC1073 Programming 1 2023 S1 Assessment 3

Java编程作业代写|COSC1073 Programming 1 2023 S1 Assessment 3

这是一篇来自澳洲的关于用Java语言编写一个面向对象的控制台应用程序的Java编程作业代写

 

背景资料

对于此评估,您需要使用 Java 编程语言编写一个面向对象的控制台应用程序,该应用程序遵循以下基本的面向对象编程原则:

a) 你的代码应该遵循良好的面向对象原则,如封装、组合、内聚等……

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

c) 在需要和适当时使用 getter 和 setter 方法,同时考虑范围和可见性。

d) 在有充分理由的情况下使用静态变量和方法,例如减少代码重复,同时仍然保持良好的面向对象设计。

 

Background Information

For this assessment you need to write an object-oriented console application in the Java programming language which adheres to the following basic object-oriented programming principles:

a) Your code should follow good object-oriented principles such as encapsulation,composition, cohesion, etc…

b) Setting the visibility of all instance variables to private.

c) Using getter and setter methods where needed and appropriate with consideration given to scope & visibility.

d) Use static variables and methods when there is good reason to do so, such as reducing code repetition whilst still maintaining good objected-oriented design.

You are being assessed on your ability to write a program in an object-oriented manner.

Writing the program in a procedural style is NOT permitted and will be considered inadmissible receiving a zero grade. You will also receive zero if your submission does not compile on command line, e.g. by

> javac A3_P1_2023.java

The following guidelines apply throughout this assessment:

e) You must use an array to store any collections of objects in your program.

f) You must not use ArrayList, HashMap or any other data structures within the Java API or from 3rd party libraries.

Overview

You have a start-up. Your first contract is to build a Java application for a local grocery shop.

This system is required to have three main functions: (1) uploading item information (2) reading in order information from customers (3) showing the summary accordingly.

You are provided with a template code, with some sample data files provided. To complete the system, you will implement or add several classes. We give introduction of each class and detailed instructions at each level from PASS, to CR, to DI and HD. Sample outputs are also provided below for each level.

Item class – It has (at least) four instance variables: String name, double unitCost, double unitPrice, int stock.

It has only one constructor which takes four parameters, e.g.

Item(“Apple”, 12.7, 20.5, 50)

Parameters represent (1) the name of the item, (2) its cost per unit, e.g. in kg, in box, that is the buying price from wholesalers, (3) its selling price per unit, e.g. in kg, in box, (4) the available stock which is initialised at the beginning. In the above example, the item is Apple,buying at $12.7 per box, selling at $20.5 per box, with 50 boxes initially added into the stock.

The information of items are stored in “items.txt” which is included in the provided zip file.

See below for its content. This shop only sells these 7 items. You may change the values to test your program. But DO NOT change the item name nor the order.

Apple 12.7 20.5 50

Banana 6.55 7.8 30

Coke 1 1.5 100

Donut 2 4 20

Egg 1.15 3.3 50

Fish 13.5 22.2 10

Grapes 1.3 3.5 3

You can assume the file will never be corrupted. Its data will always be in the right data format,although the value might be invalid (see later for details).

Order class – Each order has a customer which is a String, and an int array orderedItems to store the details of the order. There is a capacity in the class. It is always 20 as the shop cannot handle orders that contains more than 20 items. The fee for handling/delivering one order is always $9.99, unless it is set by one of its methods charge(double fee).

The order info are stored also in a file. An example “orders.txt” is included in the provided zip file. Below is its content. You may change values to test your program. The first line is the total number of orders. Each line is an order starting with the customer name (in one string, no spaces), then 7 ints for the seven kinds of items listed above. The sequence is the same as that in items. A value 0 means item not order. For example Frodo ordered 1 unit of banana, 2 units of coke, 1 unit of egg, 2 units of fish and 1 unit of grapes, no apple and donut.

4

Frodo_Baggins 0 1 2 0 1 2 1

Mary_Popping 2 1 3 10 0 0 0

Farhad_Osmen 0 0 0 0 10 0 10

Mary_Popping 1 2 3 4 3 2 1

You can also assume that the order file is never corrupted. Its data always are in the right data format, although it may contain invalid values (see later for details).


程序辅导定制C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持 Alipay WeChatPay PayPal等支付方式

E-mail: vipdue@outlook.com  微信号:vipnxx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。