PROG2004 C/C++

Java Python Assessment Brief

PROG2004
Object Oriented Programming (Assessment 1)

Title Assessment 1
Type Programming
Deadline 4 December 11:59 AM
Weighting 20%
Academic Integrity Contract cheating and the use of GenAI, such as ChatGPT, in this assignment are strictly prohibited. Any
breach may have severe consequences.
Submission You will need to submit 2 Java projects as detailed.
Unit Learning Outcomes This assessment task maps to the following ULOs:
• ULO1: explain, compare, and apply advanced class design concepts
• ULO2: apply object-oriented programming principles to solve intermediate problems
• ULO3: distinguish between and use advanced collection classes 2
Assessment Brief

Task 1:

In this assignment, you will write the code that manages the product categories on any website, such as Alibaba (Use another website).

To get started:

• Create a new Java project called Project1 in IntelliJ.
• In the src directory, create a new class called AssignmentOne.
• In the AssignmentOne class, create the main method. 3
Assessment Brief


Module 1 - Advanced class design
The following part of the assessment covers the content in Module 1.
Part 1 – Creating abstract classes and interfaces
Go to the website you choose and explore all the different categories of products that they sell. While you are doing this, have a look at the
different product categories as they go from more general to more specific. At the top level of the Inheritance hierarchy, you need a generic
product. In your Java project:
• Create a new interface called Product with at least two generic methods that are suitable for ALL product categories on the the website
you choose.
Alibaba sells physical and digital products. Therefore, in the inheritance hierarchy, under products, you would need to handle physical products
and digital products. In your Java project:
• Create an abstract class called PhysicalProduct that implements the interface called Product.
• Create an abstract class called DigitalProduct that implements the interface called Product.
The PhysicalProduct and DigitalProduct abstract classes must have the following at a minimum that are suitable for ALL physical OR digital
product categories on the Alibaba website:
• At least two instance variables
• A default constructor
• A second constructor that sets all the instance variables
• At least one abstract method
• At least one non-abstract method
• Any other methods or variables that you feel are necessary for the class to be usable in the program


Part 2 – Using abstract classes and interfaces
On the Alibaba website, choose one physical product category and one digital product category. In your project:
• Create one concrete class that extends the PhysicalProduct abstract class.
• Create one concrete class that extends the DigitalProduct abstract class.

The classes should match the physical product category and digital product category you chose on the Alibaba site and have the following at
a minimum: 4
Assessment Brief


• At least two instance variables (one of these variables must be a boolean as a boolean instance variable is required in a later section of the
assignment)
• A default constructor
• A second constructor that initialises all the instance variables (including the instance variables in the abstract superclass)
• A method that prints the Product details, e.g. "The product details are:" followed by all instance variables formatted for readability
(including the instance variables in the abstract superclass)
• Any other methods or variables needed so that your products match the physical product category and digital product category you
chose on the Alibaba site.
For each class, in the class comments, you MUST provide a link to the product category on Alibaba that you based
your class on. In the main method:
• Add the following comment - // Part 2 – Using abstract classes and interfaces
• Create an object for the concrete class that extends the PhysicalProduct abstract class using the constructor that sets all instance
variables.
• Create an object for the concrete class that extends the DigitalProduct abstract class using the constructor that sets all instance
variables.
• Add the following code - System.out.println(" -------------------- ");


Part 3 – Polymorphism
In the AssignmentOne class, write a method called demonstratePolymorphism that takes one parameter. The parameter type can be either a:
• Product
• PhysicalProduct
• DigitalProduct

In the main method:
• Add the following comment - // Part 3 – Polymorphism
• Add a second comment that explains how you are going to use the method you just created to demonstrate your understanding of
polymorphism
• Write the code to create an object and use the method you just created to demonstrate your understanding of polymorphism
• Add the following code - System.out.println(" -------------------- "); 5
Assessment Brief


NOTE: Do not remove the code in the main method for Part 2 (or any other part of the assignment). You can comment it out when you are
developing; however, when you submit your assignment, the main method must contain all the code required for all parts of the assignment, i.e.,
your marker should be able to run your main method, and all parts of your assignment should run in one go.


Module 2 – Generics and lambdas
The following part of the assessment covers the content in Module 2.
In Part 2 of this assessment, you created a concrete class that extends the PhysicalProduct abstract class. For the remainder of this
assessment, this class will be referred to as yourClass as, in theory, all students should have a different name for this class.


Part 4 – Generic classes
In this part of the assignment, you are going to write the code for an ArrayList that can store instances (objects) of
yourClass. In the main method, write the code to:
• Add the following comment - // Part 4 – Generic classes
• Declare an ArrayList
• Add at least 5 instances of yourClass to the ArrayList
• Add the following code - System.out.println(" -------------------- ");


Part 5 – Generic methods
In this part of the assignment, you are going to sort the ArrayList that we created in part 4.
In yourClass, implement the Comparable interface. When you implement the compareTo() method from the Comparable interface, you must
use at least two instance vari PROG2004、C/C++ ables in the comparison.
Once you have implemented the Comparable interface in the main method:
• Add the following comment - // Part 5 - Generic methods
• Write the code to sort the ArrayList that you created in Part 4.
• Add the following code - System.out.println(" -------------------- "); 6
Assessment Brief


Part 6 – Wildcards
In the AssignmentOne class, create a method called DemonstrateWildcards that takes an ArrayList generic parameter . In
the method, call one of the methods from PhysicalProduct abstract class.
In the main method:
• Add the following comment - // Part 6 - Wildcards
• Add a second comment that explains how you are going to use the method you just created to demonstrate your understanding of wildcards
• Write the code to create an object and use the method you just created to demonstrate your understanding of wildcards
• Add the following code - System.out.println(" -------------------- ");


Part 7 – Simple lambda expressions
In the AssignmentOne class, create a method called DemonstrateLambdas that takes an ArrayList of yourClass and a Predicate as a
parameter. In the method, test the Boolean instance variable from yourClass and print a suitable message based on whether it is true or false.
In the main method:
• Add the following comment - // Part 7 - Simple lambda expressions
• Write the code to pass the Arraylist that you created in Part 4 to the DemonstrateLambdas method
• Add the following code - System.out.println(" -------------------- ");

• Add a default constructor and a second constructor that sets the instance variables (Staff and Person) using parameters
• Add getters and setters for all Staff instance variables


In the Member class:
• Extend the Person class
• Add at least 2 instance variables suitable for a School member
• Add a default constructor and a second constructor that sets the instance variables (Member and Person) using parameters
• Add getters and setters for all Member instance variables
In the Classroom class:
• Add at least 3 instance variables suitable for a Clasrooms. One of these instance variables must be of type Staff, i.e. used to track the trainer
running the Classroom.
• Add a default constructor and a second constructor that sets the instance variables using parameters.
• Add getters and setters for all Classroom instance variables.

In the AssessmentTwo class add the following code:
public class AssessmentTwo {
public static void main(String[] args) {
}
public void partOne(){
}
public void partTwo(){
}
public void partThree(){
}
public void partFour(){
}
public void partFive(){
}
public void partSix(){
}
}
9
Assessment Brief

Module 3 - Advanced Collections
The following part of the assessment covers the content in Module 3.

Part 1 – Lists
The Classroom class is missing the ability to store a collection of Members who have signed up for the Classroom. For this part of the assignment:

• Using a LinkedList, update Classroom so that a Classroom object can store a collection of Members (i.e. datatype Member) who have signed up for
the
Classroom.

In addition to adding a LinkedList, you need to add the following methods to Classroom that work with the LinkedList:

• A method to add a Member to the Classroom.
• A method to check if a Member is in the Classroom.
• A method to remove a Member from the Classroom.
• A method that returns the number of Members in the Classroom.
• A method that prints the details of all Members signed up for the Classroom (you must use an Iterator or you will get no marks).

Note: Make sure all the above methods print suitable success/failure messages.

Demonstration
In the partOne method in the AssessmentTwo class:
• Create a new Classroom object.
• Using the methods you created:
o Add a minimum of 5 Members to the LinkedList.
o Check if a Member is in the LinkedList.
o Remove a Member from the LinkedList.
o Print the number of Members in the LinkedList.
o Print all Members in the LinkedList. 10
Assessment Brief


Part 2 – Collection Class
There is no way to sort the Members who have signed up for a Classroom. For this part of the assignment:
• Create a class (you can choose the name) that implements the Comparator interface. When you implement the compare method from the Comparator
interface, you must use a minimum of two of the instance variables in your comparison.
• Create a method in the Classroom class that sorts the LinkedList using the sort(List list, Comparator c) method in the Collections class.

Note: You MUST use the Comparator interface. You CAN NOT use the Comparable interface.

Demonstration
In the partTwo method in the AssessmentTwo class:
• Create a new Classroom object.
• Using the methods you created:
o Add a minimum of 5 Members to the LinkedList.
o Print all Members in the LinkedList.
o Sort the LinkedList
o Print all Members in the LinkedList again to show that the LinkedList has been sorted.


Part 3 – Queue Interface
As most School classes would have a maximum number of members that can sign up, the program needs the ability to keep track of Members who
are waiting to join the School class and the order in which they joined the waiting list, i.e., first in first out.
For this part of the assignment:
• Using a Queue, update the Classroom class so that a Classroom can store Members (i.e., Member objects) who are waiting to join the Classroom.

In addition to adding a Queue, you need to add the following methods to the Classroom class that work with the Queue:
• A method to add a Member to the Queue.
• A method to remove a Member from the Queue.
• A method that prints all the details for all Members in the Queue in the order they were added.

Note: Make sure all the above methods print suitable success/failure messages. 11
Submission ZIP file via USB drive (Name+ Complete student number + Assignment 1)
You are required to submit Three items for this assessment, including:
• Project 1
• Project 2
• A 10 minutes video explain Project 1 and Project 2
Assessment Criteria
• Java code compiles with Java 17 LTS.
• Use of correct coding style, including the use of comments.
• Accuracy of coding.
• Use of suitable coding structures.
• Correct submission and naming conventions of assessment items as required         

内容概要:本文档介绍了基于3D FDTD(时域有限差分)方法在MATLAB平台上对微带线馈电的矩形天线进行仿真分析的技术方案,重点在于模拟超MATLAB基于3D FDTD的微带线馈矩形天线分析[用于模拟超宽带脉冲通过线馈矩形天线的传播,以计算微带结构的回波损耗参数]宽带脉冲信号通过天线结构的传播过程,并计算微带结构的回波损耗参数(S11),以评估天线的匹配性能和辐射特性。该方法通过建立三维电磁场模型,精确求解麦克斯韦方程组,适用于高频电磁仿真,能够有效分析天线在宽频带内的响应特性。文档还提及该资源属于一个涵盖多个科研方向的综合性MATLAB仿真资源包,涉及通信、信号处理、电力系统、机器学习等多个领域。; 适合人群:具备电磁场与微波技术基础知识,熟悉MATLAB编程及数值仿真的高校研究生、科研人员及通信工程领域技术人员。; 使用场景及目标:① 掌握3D FDTD方法在天线仿真中的具体实现流程;② 分析微带天线的回波损耗特性,优化天线设计参数以提升宽带匹配性能;③ 学习复杂电磁问题的数值建模与仿真技巧,拓展在射频与无线通信领域的研究能力。; 阅读建议:建议读者结合电磁理论基础,仔细理解FDTD算法的离散化过程和边界条件设置,运行并调试提供的MATLAB代码,通过调整天线几何尺寸和材料参数观察回波损耗曲线的变化,从而深入掌握仿真原理与工程应用方法。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值