Write a program to calculate the power consumed by a heater. This program also calculates the resistance value for the heater. The program’s design should use main that calls the three functions described below:
a) getData : Read data from the keyboard. This function is to use reference parameters (pass-by-reference concept) to read the voltage and the current.
b) calculate: To calculate the power and resistance for each heater. This function passes power and resistance by reference via a reference parameter.
c) displayPowerResistance :To display the power and resistance for each heater.

Votes + Comments
baby got back.
Stop mooching and read the rules.
5 Years
Discussion Span
Last Post by akhlakeng

You write it first.

We aren't going to give you the code. You have to write it yourself. If you put forth a good-faith effort and have a problem with a particular part of your code, post a proper question; then you'll get something useful.

I'll give you this though:

//header #includes

//function prototypes

//constant definitions

int main() {
  return 0;

//function implementations

Edited by Fbody: n/a


Then I suggest you pay attention in class. Your posted questions (this one, and your triangle one) are obviously school assignments. The funny thing about homework is that it usually requires you to use a skill you either just learned or should already know to accomplish a task.

Get your book out and read it, pay attention in class, and do your own work; otherwise, you'll never learn it.

If you really are that lost, here's some reading material.

Edited by Fbody: n/a


okay..thanks for your help! i already know how to do it :D

If you already know how to do it, why are you wasting our time? I don't think anyone besides you will consider that funny. :(

Edited by Fbody: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.