Lab
3
Get started now
Building a fan ========================== 5 8.0x6.0x0.0625 sheets ========================== Duplicate part: 8.0x6.0x0.0625 sheet Copies: 5 Individual cost: $1.50 Individual weight: 0.3 lbs Total cost: $7.12 Total weight: 1.5 lbs ========================== 8.0x6.0x0.0625 sheet ========================== Length: 8.0 inches Width: 6.0 inches Thickness: 0.0625 inches Cost: $1.50 Weight: 0.3 lbsAn assembly consists of multiple different parts. Both the cost and weight of the assembly are determined by adding the cost and weight of each part in the assembly. However, the assembly has an additional construction cost which is $0.25 per sub-part in the assembly. The assembly maintains a `List` of all the parts that are stored in it. A duplicate part or an assembly may be a sub-part of another part. For example, in the cube option in the program [MachineDriver.java](MachineDriver.java), the cube consists of two parts: a set of metal sheets and several sets of nut-bolt pairs. The set of sheets is actually a duplicate part, consisting of six identical pieces of sheet metal. The sets of nut-bolt pairs are also a duplicate part, consisting of 36 identical nut-bolt pairs. Each nut-bolt pair is an assembly, consisting of both a nut and a bolt. This hierarchy of parts is illustrated in the diagram below.