Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

New Class: PowerSupply This class will represent a power supply unit with interesting characteristics: Physical Type: S ( switching , very light ) or T

New Class: PowerSupply
This class will represent a power supply unit with interesting characteristics:
Physical Type: S (switching, very light) or T (transformer-based, very heavy)
Voltage Type: F (fixed 13.8vDC) or V (variable voltage, 320vDC)
Current Handling: two numbers, separated by a slash, one indicating the maximum
temporary current available in amperes (amps), and another representing the 100%
duty cycle operating current (i.e.33/30)
Meter Configuration: the type of meters found on the power supply:
N (no meters)
V (voltage meter only)
C (current meter only)
B (both voltage and current meters)
You must design and implement the PowerSupply class in your project. Create the constructor
and the dunder stringifier (the thing that returns the string representation) to represent a
Mount. This time, we wont make you create mutators, since we will not be using them. You
will still need to make accessors for the stated attributes. For the purposes of the accessors,
it will return the codes that were found in the files, as shown above but your __str__ should
translate those codes into plain-text explanations. A few static dictionaries will help with
this.
Upgrades
Remember that code you wrote in your Driver that took a frequency range and computed the
midpoint band metre value? That should now be moved into the RadioToolbox, as a function
called compute_midpoint_from_frequency.
You need to upgrade the Radio class to accept new information. Radios must now additionally
have power supply amperage requirements (the same type of information that a PowerSupply
has. You cannot connect a Radio to a PowerSupply if the PowerSupply doesnt have enough
amperage to ensure safe operation (and, for our purposes, the amperage requirement of the
Radio should be no more than 80% of the 100% duty cycle (continuous) amperage rating of
the power supply in order to be considered safe). This isnt the job of the Radio to deal with
youll see, later, how that happens. The Radio just stores the amperage required for operation
(and already stores how it gets its power). Add accessors to Radio to get the new instance
variable. As we mentioned for the PowerSupply, you can skip the mutators for this in the
Radio, too. Check the radios.txt file for details. Hint: does the 80% rating have anything to do
with the Radio object, or will you put that somewhere else?
Youve now probably noticed that youre going to have the same information in PowerSupply as
in Radio amperage values and these will be used in determining compatibility.
There are no changes to Antenna at this time.
Data Files
You will be given a new set of data files for this assignment do NOT use the ones from AS1,
they wont work. Additionally, there is a new file, powersupplies.txt, that will describe the
power supplies systems:
physical_type, voltage_type, current_handling, meter_configuration, manufacturer, model identifier
Example:
S,F,10/10,N,SAMLEX,SEC-1212
The Radio data file is still radios.txt but now has records of the form

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions