Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

I don't know where the bug in this code. Please help me, thank you.

Answered: 1 week ago