Professional Documents
Culture Documents
KERON
TOOMA (M.SC.)
TUTOR: KEVIN K. KENNEDY
COURSE: INTRODUCTION TO PROGRAMMING
MAIN QUESTION
Develop a C++ console application that stimulates the idea of POS System that allows a user to
calculate the total bill of five products for each sale.
First declare the following global variables initialised to the respective values:
double maxSaleTotal = 0.0;
double minSaleTotal = 99999999999999999999999999999999999999999999999.9;
string maxCashier = ;
string minCashier = ;
Secondly, with the aid of a function called menu () display the following main menu and
consequently accept the numerical option from the user. The menu() function should return the
1|Page
Thirdly, utilise a function named makeSale() that is invoked whenever the user enters 1, that
allows the user to enter the price for five products in each sale transaction. The price for each
product is as follows: Product 1 - 1.5, Product 2 - 1.0, Product 3 - 2.0, Product 4 - 2.5, and
Product 5 - 1.5. Consequently display the total sale bill, as well as ask the user to enter their
name. Use the global variables to keep track of the maximum and minimum total bill, as well as
the cahier who made the transaction for the respective maximum and minimum total bill. After
the user has entered their name invoke bargraph() function that accepts an array with the subtotal
for each product, as well as the size of the array. The bargraph() function should display a
horizontal asterisks bar graph dependent on the respective sub totals. Allow the user to continue
making sale transactions by entering Y otherwise ask the user to enter N if they do not wish to
make another sale transaction. An illustration of the above mentioned instruction is shown below.
2|Page
Fourthly, utilise a function named viewItems() that is invoked whenever the user enters 2, this
function shoud display the screen as shown below:
Fifthly, utilise a function named maxSale() that is invoked whenever the user enters 3, this
function should display the screen as shown below with the utilisation of the respective global
variables that was used to store the name of the cashier whom made the maximum total bill, as
well as the maximum total bill itself.
3|Page
Sixthly, utilise a function named minSale() that is invoked whenever the user enters 4, this
function should display the screen as shown below with the utilisation of the respective global
variables that was used to store the name of the cashier whom made the minimum total bill, as
well the minimum total bill itself.
Seventhly when user enters 5, utilise the exit() function to terminate the program.
Finally, have fun and God bless.
4|Page