With the first loop I want to ask the user if she/he want to run the program again. But it seems like I have done something wrong there as well because if I input something else than y or n.

Yes that's true! If the call starts before 8 and finish after 8 you get a discount on the part that's after 8.