Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create programme in SCILAB that determines the amount of change given back to a customer in a self - service checkout machine e . g

Create programme in SCILAB that determines the amount of change given back to a customer in a self-service checkout machine e.g. vending machine.
The program generates a number between 0.01 and 50.00 and displays the amount of money you owe /needs to be paid. The program then asks the user to enter a payment. As a customer, you can only pay with one R1 coin, one R2 coin, one R5 coin, one R10 note, one R20 note, one R50 note, one R100 note or one R200 note.
If you pay with a note or a coin that is less than the amount, an error message has to be displayed. The error message should say, Sorry, please add more money to purchase.
If the payment is sufficient, the program calculates the charge and lists the bills and/or the coins that make up the change, which has to be composed of the least number of bills and coins.
For example, if the amount to be paid is R2.30 and you pay with a R10 note, then the change would be as follows:
1x R5
2 x R1
1 x 20c
1x 10c
Execute the programme ten (10) times and indicate the values you have used neatly in table format. Do not use values that require a 1c, or 2c as this has been discontinued in South Africa. The program should contain pseudocode in flowchart format or recipe format for easier understanding. Ensure that each line of code/ majority of the code has a description on the side, which explains to the marker what your train of thought was used i.e. make use of the // symbols
Tips:
You will need to make use of a combination of loops
You can make use of switch case loops as well.
Make use of the textbooks and other resources to assist you.
SUBTOTAL: [40]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

Students also viewed these Databases questions