you are designing a matlab script that will function as an automated cash regisiter. the cash register will recive two inputs,the price of an item in cents, and the amount of cents payed by the customer. the cash register will then dispense change using the highest denominations of currency available ranging from 1 dollar bill to a penny
dollar = 100 cents
quarter =25 cents
dime= 10 cents
nickel=5
penny=1 cent
your program should ensure that the highest available denomiation of currency is first used. if a customer is owed 128 cents in change, you should not dispense 128 pennies.
below is a list showing the current amount of currency stored in the cash register
2 dollars
3 quarters
2 dimes
1 nickel
9 pennies
requirements
1- ask the user to enter the price of the item in cents
2- ask the user to enter the amount of cents given to pay for teh item
3-determine and display the amount of change owed based on the price of the item and the amount of cents given
4-determine and display the correct number of dollars to dispense
5- determine and display the correct number of qaurters to dispense
6-determine and display the correct number of dimes to dispense
7-determine and display the correct number of nick to dispense
8- determine and display the correct number of pennies to dispense
9- after compelting a transaction display the remaining number of dollars,quarters,nickles,dimes and pennies still stored in the cash register
10-if there is not enough availabe currency to dispense proper amount of change then inform the user the transaction is NULL
Rubric
-get user input for price of item in cents and amount of cents oaid for item (20 points)
-determine and display the amount of cents owed in change (20 points)
-determine and display the correct amount of dollars to return (15 points)
-determine and display the correct amount of quarters to return (10 points)
-determine and display the correct amount of dimes to return (5 points)
-determine and display the correct amount of nickles to return (5 points)
-determine and display the correct amount of pennites to return (5 points)
-Display the remaining currency stored in the machines (10 points)
plz do it in mathlab ASAP


dollars = input("Enter dollars: ")
cents = input("Enter cents: ")
dollars += floor(cents/100 )
cents = mod(cents, 100);
quarter = 0;
dimes = 0;
nickles = 0;
if cents >= 25
quarter = floor(cents/25);
cents = fmod(cents, 25);
fprintf("%d ", quarter);
if(quarter == 1)
fprintf("quarter")
else
fprintf("quarters")
end
end
if cents >= 10
dimes = floor(cents/10);
cents = fmod(cents, 10);
fprintf("\n%d ", dimes);
if(dimes == 1)
fprintf("dime")
else
fprintf("dimes")
end
end
if cents >= 5
nickles = floor(cents/5);
cents = fmod(cents, 5);
fprintf("\n%d ", nickles);
if(nickles == 1)
fprintf("nickel")
else
fprintf("nickels")
end
end
if cents > 0
fprintf("\n%d ", cents);
if(cents == 1)
fprintf("penny")
else
fprintf("pennies")
end
end
you are designing a matlab script that will function as an automated cash regisiter. the cash...
in c code
x Global Soccer 1.docx x Acceleration Due to 6 x M Inbox (5,949) - joshfor x M Inbox (4,224) - joshuar X ® AC ads/ACFrOgA6UB 1k4Z1i1xGLNQ1Lntj510 lutEUaA..pdf ECE 175: Computer Programming for Engineering Applications Lab Assignment #2 (Thursday sessions) Relevant Programming Concepts: • Branch Structure • Loop Problem 1 (15 points): Develop a C program that asks a user to enter a total change amount in cents) and outputs the change using the fewest coins. The coin...
HELP ( i get these comment for this assignment please help me to fixed Please do not ask user to enter cents. Amount due and received should be in dollars such as 2.35 and 5.) Business P2.8Giving change. Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount received from the customer. Display the dollars, quarters, dimes, nickels, and pennies that the customer should receive in return. #include <iostream>...
All items at a "Penny Fair" are priced less than $1.00. Write a program that makes change with a minimum number of coins when a customer pays for an item with a one dollar bill. Prompt for the item price in cents, report the change due, and the number of coins of each denomination required. Use only quarters, dimes, nickels, and pennies for change (no 50 cent pieces). See sample output but your program should work for any item price....
C++ HW Question Your program will simulate a simple change maker for a vending machine. It will start with a stock of coins and dollars. It will then repeatedly request the price for an item to be purchased or to quit. If given a price, it will accept nickels, dimes, quarters, one-dollar and five-dollar bills—deposited one at a time—in payment. When the user has deposited enough to cover the cost of the item, the program will calculate the coins to...
PLease help!!! how to type them in Python !!!! Python help!!
THank you so much
Problem 1: (20 points) Optimal change You will write a program that uses the // and % operators to figure out how to give change for a specified amount using the minimum number of coins (quarters, dimes, nickels, cents). The good news is that our currency is specifically designed to make this problem easy. For a given number of cents, first use as many quarters...
In C++ Consider a cash register that uses an automated machine. For the “paper money inserted”, and the “amount of purchase”, the machine returns “paper money and coins”. Write a program that gets from user the following “paper money inserted” and the “amount of purchase”, and display the output as: Purchase 3.08 Payment 10.00 Change 6.92 Dollars 6 Quarters 3 Dimes 1 Nickels 1 Pennies 2 Hint: - to get “dollars” and “coins” use : static_cast < int > -...
C Program that prompts the user to enter a number that represents a pile of pennies. Then, the program should use that input value to distribute the cents over monetary denominations of dollars, half dollars, quarters, dimes, nickels and pennies. Distribute the pennies over the other denominations with Change function : prototype: void Change(int *dollars, int *halfDollars, int *quarters, int *dimes, int *nickels, int *pennies); The function takes a logical input value via its pennies parameter that represents the total...
Construct a program in C++ that exchanges coins for cash like Coinstar that is located in several grocery stores. You will prompt the user to provide you with the total number of pennies, nickels, dimes, and quarters, respectively. You are to determine the total amount of money entered by the user and then output the cash that should be received. For example, if a user enters 50 pennies, 10 dimes, 10 nickels, and 5 quarters, then the user would receive...
Write a C program that calculates exact change. In order to receive full credit, please remember that only int arithmetic is exact, so you’ll need to break up your double into two ints, the one before the decimal point and the one after the decimal point. Another point worth mentioning is that the % operator gives the remainder. In other words, when working with int values, 9 / 5 = 1 whereas 9 % 5 = 4. Keep this in...
Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. 2. Repeatedly prompt the user for a price in the form xX.xx, where X denotes a digit, or to enter q' to quit 3. When a price is entered a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a 'q)...