|
#include <iostream.h> #include <stdlib.h> #include <iomanip.h>
using namespace std; float total(float quarters,float dimes ,float nickels, float pennies);
int main() { float quarters,dimes,nickels,pennies,total; cout<<"Please enter the number of quarters you have:"<<endl; cin>>quarters; cout<<"Please enter the number of dimes you have:"<<endl; cin>>dimes; cout<<"Please enter the number of nickels you have:"<<endl; cin>>nickels; cout<<"Please enter the number of pennies you have:"<<endl; cin>>pennies; cout<<"The total is "<<(quarters,dimes,nickels,pennies)<<total<<endl; system ("PAUSE"); return 0; }
float calculatedtotal (float quarters, float dimes, float nickels, float pennies) { float returnValue; returnValue = ((quarters *.25)+(dimes *.10) +(nickels *.05) +(pennies *.01)); return returnValue; }
|