Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Which function is most appropriate to improve the given code? Flowchart Main has 1 0 float variables ( powerConsumptionApp 1 , powerConsumptionApp 2 , powerConsumptionApp
Which function is most appropriate to improve the given code?
Flowchart Main has float variables powerConsumptionApp powerConsumptionApp powerConsumptionApp hoursOfUse hoursOfUse hoursOfUse energyPerDay energyPerDay energyPerDay totalEnergyConsumed and nodes. Node is the start node and points to node Node code: powerConsumptionApp Node points to node Node code: hoursOfUse Node points to node Node code: energyPerDaypowerConsumptionApp hoursOfUse Node points to node Node code: powerConsumptionApp Node points to node Node code: hoursOfUse Node points to node Node code: energyPerDaypowerConsumptionApp hoursOfUse Node points to node Node code: powerConsumptionApp Node points to node Node code: hoursOfUse Node points to node Node code: energyPerDaypowerConsumptionApp hoursOfUse Node points to node Node code: totalEnergyConsumed energyPerDay energyPerDay energyPerDay Node points to node Node puts to output the string: The total energy consumed per day is Node points to node Node code: Put totalEnergyConsumed to output Node points to node Node puts to output the string:
Node points to node Node is the end node.
a
Flowchart ComputeTotal has parameter variables float energyPerDay float energyPerDay float energyPerDay return variable float total and nodes. Node is the start node and points to node Node code: total energyPerDay energyPerDay energyPerDay Node points to node Node is the end node.
b
Flowchart InputValues has parameter variables float power, float hoursno return variable, and nodes. Node is the start node and points to node Node code: power Get next input Node points to node Node code: hours Get next input Node points to node Node is the end node.
c
Flowchart ComputeEnergyConsumed has parameter variables float power, float hours return variable float energy and nodes. Node is the start node and points to node Node code: energy power hours Node points to node Node is the end node.
d
Flowchart PrintPowerConsumed has parameter variable float totalEnergyConsumed no return variable, and nodes. Node is the start node and points to node Node code: Put totalEnergyConsumed to output Node points to node Node puts to output a newline Node points to node Node is the end node.
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