Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prob. 1 The program is required to compute the sum and average of a series of numbers a user enters. Using the template python file

Prob. 1
The program is required to compute the sum and average of a series of numbers a user enters.
Using the template python file
Problem1Temp.py, complete the code.
Prob. 2
Points: 40
A Python program has to be developed to display with three LEDs whether a quadratic equation
shown below has real roots or complex roots or roots can't be computed and turn off the three
LEDs (Red, Yellow, and Green) by pressing a pushbutton switch:
ax2+bx+c=0
Red LED (Coefficient a is small): If a tolerance, where the value of tolerance is 0.1
value
Yellow LED (Complex roots): If the value of b2-4ac0.0
Green LED (real roots): if b2-4ac0.0
Hardware Setup (Traffic Light and a PushButton):
Red LED is connected to GPIO 26.
Yellow LED is connected to GPIO 19.
Green LED is connected to GPIO 6.
One terminal of the Pushbutton switch is connected to GPIO 17. Determine the
connection of the other terminal of the PushButton.
Python Code:
Using the skeleton Python script provided in the "
Prob2Temp.py" implement the
program.
Verify your implementation by inputting the following three quadratic equations:
3.0x2+4.0x+2.0=0.0
x2+4.0x-2.0=0.0
0.05x2+4.0x-2.0=0.0
After inputting each equation, reset the LEDs by pressing the Pushbutton.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

14-19 Compare the two major types of planning and control tools.

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago