1. Develop a program for an automatic teller machine (ATM) designed to dispense money efficiently. The program should prompt the user to input a desired amount (which must be a multiple of 10 dollars), and the ATM should then determine the optimal combination of bills to dispense, including 100s, 50s, 20s, and 10s. You are required to write a function that calculates the quantity of each type of bill to be dispensed based on the user's input. The C program provided in this assignment accomplishes the following tasks: Finish the provided code according to the earlier explanation. #include #include //prototype void dispense(int total,int *hundreds, int *fifty, int *twenty, int *ten); int main() { int userInput; int twenty = 0, ten = 0, fifty = 0, hundreds= 0; printf("ATM Bill Dispenser\n\nEnter an amount that is a multiple of 10 to be dispensed\n"); do{ printf("Enter desired amount: "); scanf(" %d", &userInput); //check that userInput is a multiple of 10 if(){ printf("Invalid value, please try again.\n");
1. Develop a program for an automatic teller machine (ATM) designed to dispense money
efficiently. The program should prompt the user to input a desired amount (which must
be a multiple of 10 dollars), and the ATM should then determine the optimal
combination of bills to dispense, including 100s, 50s, 20s, and 10s. You are required to
write a function that calculates the quantity of each type of bill to be dispensed based on
the user's input.
The C program provided in this assignment accomplishes the following tasks: Finish the
provided code according to the earlier explanation.
#include <stdio.h>
#include <stdlib.h>
//prototype
void dispense(int total,int *hundreds, int *fifty, int *twenty, int *ten);
int main()
{
int userInput;
int twenty = 0, ten = 0, fifty = 0, hundreds= 0;
printf("ATM Bill Dispenser\n\nEnter an amount that is a multiple of 10 to be
dispensed\n");
do{
printf("Enter desired amount: ");
scanf(" %d", &userInput);
//check that userInput is a multiple of 10
if(){
printf("Invalid value, please try again.\n");
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images