Question
This ends the guided walkthrough portion of the lab . For the final steps of the lab it is your responsibility to take this pseudocode
This ends the guided walkthrough portion of the lab. For the final steps of the lab it is your responsibility to take this pseudocode and convert it into code. I have provided the pseudocode for both FindHighest and FindLowest functions. Things to look out for: you can use either the For Loop or For Each Loop nodes for this assignment, the return node needs to be called after the loop has looped through all the objects in the items array. Take each line of the pseudocode and break it down into logical steps. Look for keywords like "Set" or "For Each"; these will give you hints on what node to call.
For Highest use the following pseudocode for the logic:
Set a local variable named curHighest to the first item of the Items Array
For each Item in Items
If Item.cost > curHighest.cost
Set curHighest to Item
Return curHighest
For Lowest use the following pseudocode for the logic:
Set a local variable named curLowest to the first item of the Items Array
For each Item in Items
If Item.cost < curLowest.cost
Set curLowest to Item
Return curLowest
Test to make sure pressing 1 shows the text for the highest cost item and pressing 2 shows the text for the lowest cost item
Step 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