Answered step by step
Verified Expert Solution
Link Copied!

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 10 float variables (powerConsumptionApp1, powerConsumptionApp2, powerConsumptionApp3, hoursOfUse1, hoursOfUse2, hoursOfUse3, energyPerDay1, energyPerDay2, energyPerDay3, totalEnergyConsumed) and 15 nodes. Node 1 is the start node and points to node 2. Node 2 code: powerConsumptionApp1=600.85 Node 2 points to node 3. Node 3 code: hoursOfUse1=12.8 Node 3 points to node 4. Node 4 code: energyPerDay1=(powerConsumptionApp1* hoursOfUse1)/1000 Node 4 points to node 5. Node 5 code: powerConsumptionApp2=1800.45 Node 5 points to node 6. Node 6 code: hoursOfUse2=0.45 Node 6 points to node 7. Node 7 code: energyPerDay2=(powerConsumptionApp2* hoursOfUse2)/1000 Node 7 points to node 8. Node 8 code: powerConsumptionApp3=70 Node 8 points to node 9. Node 9 code: hoursOfUse3=1.5 Node 9 points to node 10. Node 10 code: energyPerDay3=(powerConsumptionApp3* hoursOfUse3)/1000 Node 10 points to node 11. Node 11 code: totalEnergyConsumed = energyPerDay1+ energyPerDay2+ energyPerDay3 Node 11 points to node 12. Node 12 puts to output the string: The total energy consumed per day is Node 12 points to node 13. Node 13 code: Put totalEnergyConsumed to output Node 13 points to node 14. Node 14 puts to output the string: .
Node 14 points to node 15. Node 15 is the end node.
a.
Flowchart ComputeTotal has 3 parameter variables (float energyPerDay1, float energyPerDay2, float energyPerDay3),1 return variable (float total), and 3 nodes. Node 1 is the start node and points to node 2. Node 2 code: total = energyPerDay1+ energyPerDay2+ energyPerDay3 Node 2 points to node 3. Node 3 is the end node.
b.
Flowchart InputValues has 2 parameter variables (float power, float hours),no return variable, and 4 nodes. Node 1 is the start node and points to node 2. Node 2 code: power = Get next input Node 2 points to node 3. Node 3 code: hours = Get next input Node 3 points to node 4. Node 4 is the end node.
c.
Flowchart ComputeEnergyConsumed has 2 parameter variables (float power, float hours),1 return variable (float energy), and 3 nodes. Node 1 is the start node and points to node 2. Node 2 code: energy =(power * hours)/1000 Node 2 points to node 3. Node 3 is the end node.
d.
Flowchart PrintPowerConsumed has 1 parameter variable (float totalEnergyConsumed), no return variable, and 4 nodes. Node 1 is the start node and points to node 2. Node 2 code: Put totalEnergyConsumed to output Node 2 points to node 3. Node 3 puts to output a newline Node 3 points to node 4. Node 4 is the end node.

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

Step: 3

blur-text-image

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

=+d) Are all of these rolls within the specification limits?

Answered: 1 week ago

Question

16.3 Describe the purpose of Canadian labour laws.

Answered: 1 week ago

Question

16.6 Outline the three waysto obtain union recognition.

Answered: 1 week ago

Question

16.5 Describe the five steps in a union organizing campaign.

Answered: 1 week ago