-
February 21st, 2011, 11:03 PM
#1
Function calling and passing problems
I have a few functions. Function A will get input from the user as will function B. Function C is to use data from functions A and B and calculate a value. I am getting compiling errors:
homework5.cpp: In function ‘int main()’:
homework5.cpp:13: error: too few arguments to function ‘float burninations(float, float)’
homework5.cpp:22: error: at this point in file
This is my code....:
#include<iostream>
using namespace std;
float get_anger_level();
float get_arm_diameter();
float burninations(float anger_level, float arm_diameter);
int main()
{
float level = 0;
float diameter = 0;
float anger_level, arm_diameter;
return 0;
}
float get_anger_level() // "FUNCTION A"
{
float anger_level;
cout << "\nEnter Trogdor's anger level: " << endl;
cin >> anger_level;
return anger_level;
}
float get_arm_diameter() // "FUNCTION B"
{
float arm_diameter;
cout << "\nEnter the diameter of Trogdor's beefy arm: " << endl;
cin >> arm_diameter;
return arm_diameter;
}
float burninantions(float anger_level, float arm_diameter) // "FUNCTION C"
{
get_anger_level();
get_arm_diameter();
float burnats = 0;
const int CONSUMATEVS = 17;
int burningPeasants = 40;
burnats = (anger_level * (1+1/static_cast<float>(CONSUMATEVS)) + burningPeasants/static_cast<float>(CONSUMATEVS) + arm_diameter);
cout << burnats << endl;
return burnats;
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|