This is Project 4 in a series of mini exercises for beginners learning C programming. Each project in the series helps you practice essential programming concepts such as variables, conditionals, formatted output, logic flow, and working with external files.
🔍 What this project adds to your learning:
- ✅ Use of multiple
boolflags for logic branching - 🧾 Nested
if/elseconditionals - 🧮 Calculating cumulative percentage-based discounts
- 📂 Reading from an external file using
fopen(),fgets(), andfclose() - 🎨 Displaying styled ASCII art from a
.txtfile
This mini project is a Movie Ticket Discount Tool, designed to simulate a terminal-based ticketing system that calculates and applies discounts based on user input.
When the program is run, it:
- Displays a styled ASCII banner (read from a
.txtfile) - Asks if the user holds a membership card (Y/N)
- Asks the user's age
- Applies relevant discounts depending on age and membership
- Calculates and displays the final ticket price
Two sample runs are shown below:
If you’d like to practice building this project yourself before reviewing the solution, follow these steps:
- Display a custom ASCII banner from a text file using
fopen(),fgets(), andfclose(). - Prompt the user to confirm if they have a membership card (Y/N).
- Ask the user for their age.
- Based on the input:
- 💳 Card members: get 10% off
- 👶 Students (under 18): get 10% off
- 🧓 Seniors (65+): get 20% off
- 💡 Multiple discounts can apply (e.g. member + senior = 30% max)
- ❌ No discount if none of the above apply
- Calculate the final ticket price with a max total discount of 30%.
- Print the result clearly with 2 decimal places.
Note: This project is already complete and includes the full solution. You can explore the code in
main.c, the ASCII banner insrc/ascii_art.txt, and the output samples in theimg/folder.
Happy coding! 🍿🎬


