Programming
Programming
Bun Talk, the local bakery, is on the cusp of a significant transformation, aiming to enhance its
customer service through automation. In a world of manual bill generation and order management, Bun
Talk has recognized the need for faster, more reliable, and efficient operations. To address these
challenges, they are embarking on a journey to automate their bakery billing procedures, a leap forward
in their commitment to customer satisfaction.
The core objective of this initiative is to provide a seamless and convenient experience for both
customers and the bakery's staff. Through a well-crafted C++ program, Bun Talk aims to offer features
such as authentication, displaying a menu of delectable breakfast items, allowing customers to select
multiple items, calculating and generating accurate bills, providing assistance through a user-friendly
help system, and enabling a smooth exit from the application. These features will not only streamline
their operations but also enhance the overall customer experience.
Moreover, by implementing appropriate data storage mechanisms like text files and employing effective
error handling, Bun Talk is poised to provide an error-free and user-friendly interface. This automation
effort ensures that Bun Talk remains a sought-after bakery, offering delicious bakery items with a
modern, efficient twist.
1.1. Programming
A computer or other technological devices like mobile phones, tables and etc. can process certain tasks
much quicker and easier than a human can process, but these devices don’t have the capability of
thinking by its own, therefore it’s important that a human to give the instruction to the device, what,
why, when and how to do or not do specific things. These instructions can be referred as a
computer/mobile program. The person who’s responsible in writing the program is named as a
programmer.
As human uses a specific language to communicate, even the computer has their own computer
programming language that can be used to build programs; which will help the programmers in
programming process. Also, as there’s many human languages, there’s many options of programming
languages as well that a programmer can use depending on their requirement.
Since the first invention of computers in the 19th century, by today the written programs seems pretty
much complicated, huge and complex than earlier hence the programmers use different type of
methodologies today in programming in order structure the programming process.
1. Procedural programming
The problem statement broken down in to procedures and to create the main program. Includes
a collection of variables, routines and subroutines. Program languages like Basic, Cobol &
Fortran uses this methodology and may suit to creating low complex programs.
Ex : Calculator
Calculator
(Main program)
Addition Divisional
(Fucntion 1) (Fucntion 2)
Multiplication Subscratcions
(Fucntion 3) Percentile (Fucntion 4)
(Fucntion 5)
2. Object oriented programming.
Solution revolves around entities or objects that are a part of the problem. Each object has its
own data store & functions on its own. The data in each object will be hidden hence only uses
the functions of each object while communicating to build the final program. Program languages
like C++ & Jana uses this methodology.
Ex : Payroll management
3. Functional programming.
Problem statement broken down in to functions with clearly defined tasks that is self-sufficient.
In this methodology the output only depends on the input, also the data & procedures work
separate unlike object oriented programming.
Ex : Payroll management
Payroll management
(main program)
Employee Leave
data maintanance calcultaion
Salary
etc.
calculation
4. Logical programming.
Problem broken down in to logical units, such as the user roles.
Ex : School management system
Students
Student
Office
staff
management Teachers
system
School
administrators
5. Structured programming.
Divide the program in to smaller sub programs and uses control statements to find solutions.
Program languages like Algol & Pascal uses this methodology. Structured programming consists
of 3 types of control statements.
5.1. Sequence structure
Uses one line after another sequential execution.
Module A
Module B
Module C
6. Modular programming.
Earlier days programmers faced many difficulties while writing, testing and modifying big and
complex programs. As a solution, modular programming invented in order to divide the program
solution in to sub modules to develop, implement & modify each separately. Also, each of these
sub modules may use different methodologies in fulfilling each given tasks.
Task 01: System Requirements Specification and Logical Diagrams
A software requirements specification (SRS) shows a roadmap and describes how a software or a
program is developed. This is referred as the basic level of the project which helps to start
documentation and communication with each party of development. Main importance of using an SRS
document is it helps to identify how, when, why, what and the risks in each stage of development early
hand. The proposed solution involves the development of a C++ program that will have the following
core functions:
Authentication
In order to guarantee that only authorized users can access the system, the application will have a login
mechanism. Users are able to log in and out as required.
Customers will be able to view the menu and the many bakery items that Bun Talk offers thanks to the
application.
Select Items
Clients will have the option of choosing several items from the menu.
Based on the products chosen, the application will determine the total cost and print the bill for the
consumer
Help
If the user needs assistance or information, the application will give it to them.
Exit
Authentication
The program will display a list of bakery items available, including their names and prices.
The menu should be easy to read and navigate.
Select Items
The system will calculate the total cost of the selected items.
It will generate a bill that includes the names of the items, their quantities, prices, and the
total amount to be paid.
Help
The program should provide guidance and information on how to use the system.
It should have a help menu that is easily accessible to the user.
Exit
User-Friendly Interface
A user-friendly interface with intuitive menus and prompts should be included in the program.
Data Storage
The system should store data about orders, user accounts, and bakery items using the proper
data storage mechanisms.
Error Handling
The application ought to gracefully handle errors and provide the user with enlightening error
messages.
Security
It should be ensured by the authentication mechanism that only authorized users are able to
access the system.
Efficiency
Login Process
Task 02: Implementation of C++ Program
#include <iostream>
#include <fstream>
#include <vector>
struct BakeryItem {
string name;
double price;
};
struct User {
string username;
string password;
};
}
return false; // Authentication failed
cout << item.name << " - $" << item.price << endl;
vector<BakeryItem> order;
double totalCost = 0;
while (true) {
displayMenu(menu);
string choice;
if (choice == "done") {
break;
if (item.name == choice) {
order.push_back(item);
totalCost += item.price;
found = true;
break;
if (!found) {
cout << "Item not found in the menu. Please try again." << endl;
cout << item.name << " - $" << item.price << endl;
int main() {
vector<BakeryItem> menu = {
{"Croissant", 2.50},
{"Muffin", 1.75},
};
vector<User> users = {
{"user1", "password1"},
{"user2", "password2"},
};
while (true) {
int option;
if (option == 1) {
string username;
string password;
placeOrder(menu);
} else {
} else if (option == 2) {
cout << "Thank you for using Bun Talk Bakery. Goodbye!" << endl;
break;
} else {
cout << "Invalid option. Please select a valid option." << endl;
return 0;
Explanation:
The program begins by reading the menu items from a file called "menu.txt" and storing them in
the menu vector.
Users can log in using the Login method, and authentication can be implemented later.
Users can select items from the menu, and the total cost is calculated using the Select Items
method.
The program provides a simple menu-driven interface for users to navigate through the
different modules.
The program needs further implementation of authentication, error handling, and printing
functionality.
The basic features of authentication, seeing bakery items, choosing items, and computing/printing the
bill are all covered by this condensed implementation. Users can place orders by choosing items from
the menu, and it uses structs to represent user accounts and bakery items.
Task 03: Test Document
Test Plan
The testing approach for the Bun Talk Bakery automation program is described in the test plan. To make
sure the software satisfies the requirements, it contains a variety of test cases.
Test Objectives
Test Cases
Test 1.1: Enter valid username and password. Expected: Successful login.
Test 1.2: Enter an invalid username and valid password. Expected: Authentication failure.
Test 1.3: Enter valid username and invalid password. Expected: Authentication failure.
Test 2.1: Verify that the menu displays all bakery items correctly.
Test 3.1: Add multiple items to the order and verify that the bill is calculated correctly.
Test 3.2: Attempt to add an item not on the menu. Expected: Error message and no addition to
the order.
Test 4.1: Access the help menu and verify that it provides useful information.
Test 4.2: Select the exit option and confirm that the program exits upon user confirmation.
Test 5.1: Stress test the program by adding a large number of items to the order and check for
performance issues.
Test 5.2: Purposefully enter invalid input during user interaction and assess the program's error
handling.
Test Results
Several scenarios were used during the testing process, and the program produced the desired results
for each test case.
User Authentication
Test 3.1: Multiple items were added, and the bill was calculated correctly.
Test 3.2: Attempting to add an item not on the menu resulted in an error message, and the item
was not added to the order.
Test 4.2: Selecting the exit option successfully exited the program upon user confirmation.
Test 5.1: The program handled a large number of items in the order without performance issues.
Test 5.2: The program correctly identified and handled invalid user inputs.
Prospective users of the Bun Talk Bakery automation program participated in user acceptance testing. A
questionnaire was used to obtain feedback:
User Acceptance Questionnaire
Very Easy
Easy
Neutral
Difficult
Very Difficult
Yes
No
3. Were you able to select items and calculate the bill without issues?
Yes
No
Yes
No
Yes
No
6. Were there any specific features or improvements you would like to see in the program?
7. Overall, how satisfied are you with the Bun Talk Bakery automation program?
Very Satisfied
Satisfied
Neutral
Unsatisfied
Very Unsatisfied
User Acceptance Feedback
Users were generally able to select items and calculate the bill without problems.
The help menu was deemed informative and useful by the majority of users.
Users suggested adding features for saving orders and personalization options.
Conclusion
The Bun Talk Bakery automation program effectively fulfilled the requirements, offering clients an easy-
to-use interface for ordering, viewing bakery products, logging in, and receiving bills. The functionality of
the program has been extensively tested, and user feedback has been positive with very few minor
suggestions for improvement. To improve the functionality and dependability of the program, more
features and data storage methods can be added.