Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this code must be java code pls help 1 Context Iterator pattern provides a way to access the elements of an aggregate object sequentially without
this code must be java code pls help
1 Context Iterator pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation. It is behavioral design pattern. Iterator helps in traversing the collection of objects in a defined manner which is useful the client applications. During iteration, client programs can perform various other operations on the elements as per requirements. 2 Problem description In this labwork you are expected to implement a program that builds computers in a manufacturing line. This will be an extension to the labwork of the previous week. This time you are going to have two computer production lines; one for office computers and one for gaming computers. However, office computer production line only able to produce 5 computers at a time and it cannot be changed. However, gaming computer line takes the number of orders in the beginning and fills the line with gaming computers so it is using an ArrayList to store them. Both have their getComputers methods where office computer line returns an array and gaming computer line returns an ArrayList. The problem starts at the Computer build line, because it takes both office and gaming product lines and calls their build functions and, since both returns different type of collections it will be elaborate to make an implementation for both. 3 Measure of success You are expected to: * Create iterator classes for both product lines, office and gaming computers * Modify Office Computer Line and Gaming ComputerLine classes so they can return a Iterator object for their content. * Create a ComputerBuildLine that takes both type of product line objects * ComputerBuildLine is going to have a function called buildComputer that takes an iterator and builds it and it should be called by another function called runLine which takes no parametersStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started