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]
Section B
10 Marks
Based on the question above, adjust the code such that, when you have amounts that are R0.49c or R0.45c in the amount, you need to give either a 50c change or a 40 c. If the amount you owe ends on R0.49, you need to receive a 50c change. If the amount you owe, ends on R0.49, you should receive a 40c change.
Create a table with the amount required and the change is given as in Section A, but only complete ten (10) iterations. Complete five (sets) of two (2) iterations. For example, five (5) iterations for rounding up and five (5) iterations for rounding down. Do not repeat the values used in Section A.
For example, if the amount you need to pay is R11.49, and you pay with R20 not, the change that you will get is as follows:
1x R5
1x R2
1x R1
1 x 50c
The 1c is discontinued therefore you cannot make use of it.

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

Who should be involved?

Answered: 1 week ago

Question

6 Compare and contrast mentoring and coaching.

Answered: 1 week ago