App to manage components from a ship, all components are displayed hierarchical. A component can have one or more sub-components and these
sub-components have their own sub-components. There is no limit in the number of levels in this hirarchical view. Each component has a sensor that monitors
its status. The statuses are displayed as following: Red means Severe, Yellow means Attention, Green means that everything is fine. The severity of these
statuses is as folows: OK-> Attention -> Severe.
If a subcomponent has a status of Attention or Severe, this status will pe propagated to the parent. If the parent has a status with a higher severity from its sensor,
the parent status will get the status with highest severity. The same rule applies to the hierarchy from the lowest submodule to the top most parent.
A component has the following fields: int ID, string Name, int Status (0-green, 1-attention, 2-severe), int ParentID
Write an algorithm that receives a list of Components and calculates how the bullets should be displayed.
The format of the method should be: void CalculateStatus (Components[])
Hello, can I get help with this:
I'm having a problem in java. I've created three arrays, one containing questions to be asked for a quiz and another one containing answer to the questions the last one is to ask questions randomly so I generated numbers from 1-10 randomly. The problem starts when I have to display the question according to the random array. The program only shows one question throughout.