Please see my comment to the question (rather a non-question).
No, this is not a "broken program", this is a program which never has been written, so there is nothing to break. And, I guess, you never learned the language you pretend to write in. For example, you need to declare all variables, use the type
double
for your calculations, to calculate power, you have to use the function
pow
(
http://www.cplusplus.com/reference/cmath/pow[
^]), and so on.
No, you need no help except a good kick: sit down and learn the subject, to learn how to do the job.
—SA