首页 > > 详细

代写SENG6110 Object Oriented Programming Programming Assignment 2 T1, 2025代写Java编程

项目预算:   开发周期:  发布时间:   要求地区:

SENG6110 Object Oriented Programming

Programming Assignment 2 (individual assessment) T1, 2025

Assignment Topic: Agricultural UAVs Using Arrays

Important:

Code submission on Canvas by 11:59pm on 11 April 2025.

Lab Demonstrations: All students are required to present their assignment draft to a lab tutor during one of the lab sessions in weeks 10, 11, or 12. Failure to demonstrate the draft during this period will result in a score of zero for the assignment.

No Use of AI Tools: The use of AI tools is not allowed.

Introduction

A UAV (Unmanned Aerial Vehicle), commonly known as a drone, is an aircraft that operates without a human pilot on board. It is remotely controlled by a human operator or autonomously programmed to follow a predetermined flight path using onboard computers and sensors. The objective of this individual assignment is to implement an object-oriented program using Arrays in Java, to manage agricultural UAVs at smart farms.

Each UAV is assigned a name, operational cost, and availability status. Each UAV can be equipped with up to three different types of sensors, in varying quantities and grades. For example, one UAV may have 2 temperature sensors of grade 1 and 3 humidity sensors of grade 4, while another UAV may have 1 temperature sensor of grade 3, 5 pressure sensors of grade 1 and 2 humidity sensors of grade 4.

The objective of this assignment is to extend the implementation of Assignment 1 using arrays and external files.

Specification

The program is designed to manage up to four UAVs, this must be done using an array. Each UAV can support up to three sensor types. This must also be done using an array.

Upon launch, the program will display a menu offering eight functions, as detailed below. The menu will reappear after each action is completed, allowing the user to select another option. This process will continue until the user chooses to exit the program.

The program should have the following functions:

1.    A user may add a UAV by providing name, operational cost and availability.

The names of two UAVs cannot be same so program will prompt for another name if the name matches with an existing  UAV. Operational cost  per  hour  and  must  be  a  positive  number. Availability is given as 0 to 5, where 0 is not available and 5 is available all the time. An error will display if 4 UAVs have already been defined and the user attempts to add a fifth UAV.

2.    A user may remove a UAV.

The user will specify the UAV’s name.

There should be an error message if the UAV does not exist.

3.    A user may add a sensor to a UAV.

The user will specify the sensor type, grade and quantity, along with the name of the UAV associated with the sensor (quantity  need to  be  positive,  if  not, the  program will show a message and ask the input again). Grade is 1 to 5, 1 being the highest and 5 being the lowest. The sensor type can be temperature, pressure, windspeed and humidity (not case sensitive). There should be an error message if the UAV does not exist or already holds 3 different types of sensors. An error message should be displayed if the user attempts to add a Sensor that already exists for a UAV (e.g. if the temperature sensor already exists on that UAV then new temperature sensor cannot be added).

4.    A user may remove sensors from a UAV.

The user will specify a sensor type, quantity to remove and UAV name.

There should be an error message if that sensor does not exist on that UAV, or the UAV doesn't exist, or if the given quantity to remove is more than the existing number of that type of sensors on that UAV. Otherwise, the quantity will be reduced by the given value. After that, if the quantity of the sensor is zero, then the sensor should be removed from the UAV. There should be output indicating this.

eg: One Temperature sensor removed from DJI Mini 1 (DJI Mini 1 is the name of UAV).

5.    A user may query for the best UAV for a task based on the given requirements. The requirements are type of sensors, number of sensors and grade of sensor. If multiple UAVs fulfill the sensor requirements then the UAV will be chosen based on firstly, less operational cost and then the one with higher availability.

eg: the user input will be:

Sensor Type: temperature

Sensor quantity: 3

Sensor Minimum Grade: 3

The temperature sensors on all  UAVs  need to  be  checked  and the  ones  meeting the requirement based on quantity and grade need to be considered.

If more than one UAV fulfill these requirements then the one with less operational cost will be selected. If operational cost is same, then the one with higher availability will be chosen. If both operational cost and availability are same, then any UAV can be selected. If  there  is  no  suitable  UAV  for  the  task,  the  output  should  be  “No  UAV  meets  the requirements”.

6.    A user may query for a list of sensors on a UAV.  The user will specify the name of the UAV.

There should be an error message if the UAV does not exist.

Otherwise, there should be output describing the sensors.

Normally, there should be one line per sensor.

eg: Temperature sensor, Grade 4, Quantity 5

If there are no sensor, the output should be one line.

eg: No sensors on DJI Mini 1

7.    A user may query about a sensor type on all UAVs. The user will specify the sensor type.

There should be an error message if the sensor type doesn't exist.

Otherwise, there should be one output line for each UAV.

eg: Temperature sensor is on DJI Mini 1, Grade 4, Quantity 5.

8.  A user may query for a list of UAVs.

There should be output, describing the total number of sensors on each UAV, the output must be alphabetically sorted using the UAV names.

Normally, there should be one line per UAV.

eg: UAV DJA has 50 sensors

UAV DJMini has 30 sensors

If there are no UAVs, the output should be one line.

eg: No UAV exists

9.  A user may export UAV and sensor information to a .txt file.

The created file should consist of one or more lines:

eg: UAV DJA has 50 sensors

UAV DJMini has 30 sensors

If there are no UAVs, the output should be one line.

eg: No UAV exists

An error message should be output if the file is unable to be created, or if a problem occurred during writing.

10. A user may want to see the results of testing the methods and shows the following for all ten tests:

eg:Test Case 1: Testing getName methods with no parameters

Expected output:  UAV Mini1

Actual output: UAV Mini1

11.Exit, to terminate the program.

Program Requirements

1)   The program should consist of 4 3 classes:

•   Sensor- stores the following details about sensors.

o         type  -  String  -  the  type  of  the  sensor  (must   be  temperature,   pressure, windspeed or humidity).

o         grade - int - the grade of the sensor, possible values are 1,2,3,4,5. 1 being the highest and 5 being the lowest grade.

o         quantity - int - the number of sensors. Must be positive.

•    Uav  -  stores  the  following  details  about  a  UAV  and  must  contain  a  method  UavTest  that performs unit testing (see lecture 8 for more details).

o         name - String - the name of the UAV.

o         Operational cost – double – cost per hour to operate the UAV.

o         Availability –  int – possible values are 0,1,2,3,4,5. 0 is not available and 5 is available all the time.

o         Sensors - array of Sensor with size 3 - the sensors held by the UAV

•    UavInterface - provides the user interface.

Uavs - array of UAVs with size 4 - the UAVs managed by the program.

All data fields of your classes should be private (this is imposed so that you apply the principles of encapsulation).

2)   Your classes will also need methods to provide the required functionalities. The only class which should have a main method is  UavInterface.java, which should create an instance of the class UavInterface, and call a method run(), which will display the menu to the user. The UavInterface class will be the only one that takes input from and sends output to the user using GUI methods.

3)   You must use arrays in this assignment, no other Java data structures (including ArrayList) are allowed

4)    Marks will be awarded for layout (including visual aspects (variable names, indentation) and structural aspects (variable scope,   method usage)), documentation (comments), and the submission's ability to perform. as specified.

What to submit -- IMPORTANT

You should submit in a compressed .zip file, via the "Assignment 2" link on Canvas:

•    Three .java files (Sensor.java, Uav.java, UavInterface.java)

o Do not include .class files in your submission.  Add comments and the name of the student on the top of each Java file submitted.

•    Word  document that contains an assignment cover sheet and the test  plan containing the following information (implemented in UavTest method):

o An overall testing plan

What are you going to test (overview)

o Test A: In a table format provide following details of testing 5 methods in Uav class:

Purpose of the test

Data to be provided

Method to be tested

Expected outcome

Actual outcome

Successful/Fail

What changes if any are required

                    o Test B: In a table format provide following details of testing 5 methods in Sensor class:

Purpose of the test

Data to be provided

Method to be tested

Expected outcome

Actual outcome

Successful/Fail

What changes if any are required



软件开发、广告设计客服
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 9951568
© 2021 www.rj363.com
软件定制开发网!