Brandon's Burgers

A small C++ application utilising basic input/output libraries

OVERVIEW

About the project

Brandon's Burgers is a small C++ application that I developed as part of my Software Engineering "Introduction to Programming" module. For my application, I created a service like JustEat, where customers can select food options and receive a receipt in a text file at the end of their order. I also went above and beyond to incorporate a discount system where the application would calculate a reduced price on the food option chosen if the code was inputted correctly.

WHEN WAS THIS?

31st January, 2024

WHAT'D I DO?

Developed a C++ application and recorded a technical discussion.

Tools Used

BACKSTORY

The Problem

Develop a C++ application with no more than 100 lines of code and use the essential input and output libraries.

The assignment brief states that the game development company requires a small C++ application that is no more than 100 lines of code and utilises input/output libraries. Developing an application using switch statements for food options to reduce lines of code is an approach that was taken.

Design & Implementation

The program that got me an A grade.

CONSOLE INPUT/OUTPUT

Personalised Menu

When developing the console outputs the user would receive when inputting information, user experience was put at the forefront. Including the customer's name in the prompts provides a more personalised approach to the application while maintaining a consistent design with the title headings. The application demonstrated a thorough understanding of the console input and output methods.

VALIDATION CHECKS

Discount System

My application included a fully working discount system, which went above and beyond the scope of the assignment. Validation checking played a crucial role in ensuring that users inputting the incorrect discount code could not benefit from the 20% reduced cost of items.

FSTREAM LIBRARY

Receipt Generation

Finalising the program, the user would receive a fully customised receipt text file based on the options they chose, with the discount factoring in how it's presented. The receipt text heavily references the variables created throughout the program for items chosen, prices, etcetera. I also utilised the fstream library to create files and write to them with the "ofstream" method.

Technical Discussion

Below is my technical discussion on the Brandon's Burgers application. It evalutes the small application, while considering basic debugging and validation methods.

REFLECTION

Project Learnings

1. Understand the code

When developing the project, it was crucial that a solid understanding of the code was present, as a technical discussion, which would include a code walkthrough, was to occur. Understanding my code fully allowed me to talk more in-depth about how the program functions and how specific methods operate.

2. Efficiency is vital

With the project requirements stating that the application must be 100 lines of code, it was crucial that the code was efficient and concise to keep to the brief. This required a tricky balance of maintaining readability and condensed code, which were my essential learning points.

3. Validation Checks

This project required me to think carefully about edge case scenarios and put myself in the users' shoes regarding how they interact with my application. Handling cases where the individual selects the wrong food option or enters the wrong discount code was a valuable lesson in validation checking.