I am currently working on the "half" practice problem in week1 of the CS50x course. I am having trouble reading a couple of lines in the code they provide and was hoping someone could clear up what they did for me.
The Line of code is:
float half(float bill, float tax, int tip);
My first thought was that it's what David spoke about in the abstraction section of the lecture, but I'm not 100%.
For context I will be writing code that will work out a bill amount including tip and tax and then half it.
float half(float bill, float tax, int tip);
int main(void)
{
float bill_amount = get_float("Bill before tax and tip: ");
float tax_percent = get_float("Sale Tax Percent: ");
int tip_percent = get_int("Tip percent: ");
printf("You will owe $%.2f each!\n", half(bill_amount, tax_percent, tip_percent));
}
// TODO: Complete the function
float half(float bill, float tax, int tip)