Quick Help with my HW?

My friend referred me to this site and wanted to know if you could find out whats wrong with my homework and why its wrong?

#include<iostream>
using namespace std;

double getPrice()
{
int x; <--- Was supposed to change this to double.
cout << "Enter the total price: ";
cin >> x;
return (x);
}

int getNumberOfPatron()
{
int y;
cout << "Enter the number of people dinning: ";
cin >> y;
return (y);

}

double calculateTips( double price, int number, double tips )
{
double Z = (price * tips) / number;
return (Z);
}


int main()
{

double price = getPrice();
int number = getNumberOfPatron();
cout << "For 10% tip price per person is $" << calculateTips( price, number, .1 ) << endl;
cout << "For 15% tip price per person is $" << calculateTips( price, number, .15 ) << endl;
cout << "For 20% tip price per person $" << calculateTips( price, number, .2 ) << endl;
return 0;

}

It seems to have an issue at getNumberOfPatron(); because when i compile and run it, It wont let me input the number of people which i dont understand why.
Thank you if you can help :)
- Muhammad
Last edited on
int getNumberOfPatron(y)

Remove the y and it should work fine
Topic archived. No new replies allowed.