cs50 / check50

This is check50, a command-line program with which you can check the correctness of your programs.
GNU General Public License v3.0
401 stars 268 forks source link

Error in finding the last required value #314

Open muhammad4373 opened 1 year ago

muhammad4373 commented 1 year ago

Here i cannot find the last value it gives me the $0.00 value everytime if anyone knows please help me out. and at the terminal window where we run our code it is showing me this Bill before tax and tip: this is wrong i cannot run the code like this it should be just like this $: right???

now after restarting when i write make half and ./ half both times it is saying that half is a directory and ./half is a directory :(

This is the code i write for my problem set 1 half.

include

include

int main (void) { int bill = get_int("bill ?"); int tax = get_int("tax ?"); int tip = get_int("tip ?");

printf(" bill is %i. tax is %i. tip is %i. , bill , tax, tip");

}

nighanxiety commented 1 year ago

now after restarting when i write make half and ./ half both times it is saying that half is a directory and ./half is a directory :( Everytime you restart your CodeSpace, the terminal goes back to the home directory. You need to use the "cd" command to go back into the directory where your program is. In this case, use cd half

printf(" bill is %i. tax is %i. tip is %i. , bill , tax, tip");

You aren't passing any values to the format parameters here, and it appears that you are not calling the half() function at all. I believe the provided distribution code included the line: printf("You will owe $%.2f each!\n", half(bill_amount, tax_percent, tip_percent)); already.

You need to implement the half() function below main so that it returns the correct value to the printf statement.