Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a matlab question i need help with this. i can't get it to work Write a program that determines the change given back

image text in transcribed

This is a matlab question i need help with this. i can't get it to work

Write a program that determines the change given back to a customer in a self-service checkout machine of supermarket for purchases of up to $50. The program generates a random number between 0.01 and 50.00 and displays the number as the amount to be paid. The program then asks the user to enter payment, which can be one $1 bill, one $5 bill, one $10 bill, one $20 bill, or one $50 bill. If the payment is less than the amount to be paid, an error is displayed. If the payment is sufficient, the program calculates the change and lists the bills and/or the coins that make up the change, which has to be composed of the least number each of bills and coins. For example, if the amount to be paid is $2.33 and a $10 bill is entered as payment, then the change is one $5 bill, two $1 bills, two quarters, one dime, one nickel, and two pennies. Execute the program three times. Answer: The amount to be paid is: $13.93 Please enter payment in dollars (1, 5, 10, 20 or 50) 20 The change is: 0 $20 bills 0 $10 bills 1 $5 bills 1 $1 bills 0 quarters 0 dimes 1 nickels 2 cents

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

=+herself to in terms of equity with regard to this assignment?

Answered: 1 week ago

Question

=+ What typical employee will the IA compare him/

Answered: 1 week ago

Question

=+7 What is the overall cost of the international assignment?

Answered: 1 week ago