# Loop through displayList         for i in range(0,len(displayList)):             # Test if the first item in the current sub-list contains the text "Price Level"             # Tip: Remember that each sub-list is a list within a list (displayList). So you have             #       to access its items via displayList followed by TWO indexes.              . . .                 # Extract the second item from the current sub-list into a variable called priceLevel                 priceLevel = . . .                 # Test if priceLevel is between previousPrice and currentPrice OR                 #         priceLevel == previousPrice OR                 #         priceLevel == currentPrice                 if(                     . . .                 ):                     # Sound the alarm. Pass in the frequency and duration.                     if self.currentPrice > self.previousPrice:                         frequency = 800                         duration = 700                                        else:                         frequency = 400                         duration = 700                     winsound.Beep(frequency, duration)                     # Print the text 'Alarm' with a green background colour, so that the user                     # can go back into the historical data to see what prices raised the alarm.                     . . .

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

In this sprint we will check if currentPrice crossed or touched any of our price levels.

If this is the case, we will have one or more price levels appearing between previousPrice and currentPrice

OR

previousPrice or currentPrice will be equel to a price level.

Add the purple code to the end of your monitorLevels() method. It must become the last code of monitorLevels().

Study the comments and complete the code


        # Loop through displayList

        for i in range(0,len(displayList)):

            # Test if the first item in the current sub-list contains the text "Price Level"

            # Tip: Remember that each sub-list is a list within a list (displayList). So you have

            #       to access its items via displayList followed by TWO indexes. 

            . . .

                # Extract the second item from the current sub-list into a variable called priceLevel

                priceLevel = . . .

                # Test if priceLevel is between previousPrice and currentPrice OR

                #         priceLevel == previousPrice OR

                #         priceLevel == currentPrice

                if(

                    . . .

                ):

                    # Sound the alarm. Pass in the frequency and duration.

                    if self.currentPrice > self.previousPrice:

                        frequency = 800

                        duration = 700                   

                    else:

                        frequency = 400

                        duration = 700

                    winsound.Beep(frequency, duration)

                    # Print the text 'Alarm' with a green background colour, so that the user

                    # can go back into the historical data to see what prices raised the alarm.

                    . . .

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education