Answered step by step
Verified Expert Solution
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 transformerbased, very heavy
Voltage Type: F fixed vDC or V variable voltage, vDC
Current Handling: two numbers, separated by a slash, one indicating the maximum
temporary current available in amperes amps and another representing the
duty cycle operating current ie
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 plaintext 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 computemidpointfromfrequency.
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 of the 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 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 AS
they wont work. Additionally, there is a new file, powersupplies.txt that will describe the
power supplies systems:
physicaltype, voltagetype, currenthandling, meterconfiguration, manufacturer, model identifier
Example:
SFNSAMLEX,SEC
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
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