Okay so first is I am confused with the void function. It is said that void function does not return a value. If for example I have a void function that gets user input, like price and month, how do I use price and month to do another function?
int main()
{
int price;
int month;
float discount;
getUserInput(price, month);
//how to get discount
return 0;
}
void getUserInput(int price, int month)
{
cout << "price: ";
cin >> price;
cout << "month: ";
cin >> month
}
float getDiscount (int price, int month)
{
float discount;
if(month > 5)
{
discount = price * 0.05
}
//code goes here
}