Question

You work at a bank and needs to automate the bills that are given to a customer when they cash a check. When the check is cas
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screenshot:

main.c WNE Ovau #include <stdio.h> int main() char choice; int amt, countTwenty=0,countTen=0,countFive-0,countone=0; printf(

Output:

Enter a dollar amount: 93 $20 bills: 4 $10 bills: 1 $5 bills: 0 $1 bills: 3 Convert another dollar amount? (Y/N): Y Enter a d

Code:


#include <stdio.h>

int main()
{
char choice;
  
do
{
int amt,countTwenty=0,countTen=0,countFive=0,countOne=0;
printf("Enter a dollar amount: ");
scanf("%d",&amt);
if(amt>=20)
{
countTwenty=amt/20;
amt=amt-countTwenty*20;
}
if(amt>=10)
{
countTen=amt/10;
amt=amt- countTen*10;
}
if(amt>=5)
{
countFive=amt/5;
amt=amt- countFive*5;
}
if(amt>=0)
{
countOne=amt;
amt=0;
}
  
printf("\n$20 bills: %d",countTwenty);
printf("\n$10 bills: %d",countTen);
printf("\n$5 bills: %d",countFive);
printf("\n$1 bills: %d",countOne);
  
  
printf("\nConvert another dollar amount? (Y/N): ");
//Note the space before %c
scanf(" %c",&choice);
  
  
}while(choice=='Y');

return 0;
}

//Thumbs Up if it helps You:)

Add a comment
Know the answer?
Add Answer to:
You work at a bank and needs to automate the bills that are given to a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Instructions You will be given an integer value less than 20. Based on the number given,...

    Instructions You will be given an integer value less than 20. Based on the number given, you will calculate the combination of ten and five dollar bills, toonies (2 dollar coins) and loonies (1 dollar coins) needed to pay such that you pay using as many of the largest bills/coins first. Details Input Input consists of an positive integer (named value) that is less than 20 (read in via input) Processing You will need declare and initialize the following integer...

  • Help with c please Much to the government's dismay, people in the U.S. prefer paper money...

    Help with c please Much to the government's dismay, people in the U.S. prefer paper money to coins. The U.S. Treasury has spent considerable time and effort trying to get people to adopt a $1 coin, but people just don't care for them. Obviously, part of the reason is that coins weigh more than paper money. The question is how much more? This project has you enter the number of paper bills you have in your wallet (twenties, tens, fives...

  • Task 4: a) Write a function named change() that has an integer parameter and six integer...

    Task 4: a) Write a function named change() that has an integer parameter and six integer reference parameters named hundreds, fifties, twenties, tens, fives, and ones. The function is to consider the passed integer value as a dollar amount and convert the value into the fewest number of equivalent bills. Using the reference parameters, the function should alter the arguments in the calling function. b) Include the function written in part a in a working program. Make sure your function...

  • In C++ Programming Write a program in Restaurant.cpp to help a local restaurant automate its breakfast...

    In C++ Programming Write a program in Restaurant.cpp to help a local restaurant automate its breakfast billing system. The program should do the following: Show the customer the different breakfast items offered by the restaurant. Allow the customer to select more than one item from the menu. Calculate and print the bill. Assume that the restaurant offers the following breakfast items (the price of each item is shown to the right of the item): Name Price Egg (cooked to order)...

  • Hello Sorry but I'm stuck in this lab. LAB - Dollar Bills Distributed: week3, Lab Session...

    Hello Sorry but I'm stuck in this lab. LAB - Dollar Bills Distributed: week3, Lab Session A Due: week3, Friday 11:59pm (late date is Sunday) PROGRAM DESCRIPTION User will input a whole number between 1 and 10, and the program will output that number as a dollar value. For example, if the user enters the number 4, the program will output the associated real value as currency: $ 4.00. Your program should prompt the user to enter in a number...

  • NOTE: ALL C PROGRAMS MUST BE DONE IN UNIX SYSTEM WITH VI EDITOR 1. Write a...

    NOTE: ALL C PROGRAMS MUST BE DONE IN UNIX SYSTEM WITH VI EDITOR 1. Write a program that asks the user to enter a U.S. dollar amount and then shows how to pay that amount using the smallest number of $20, $10, $5 and $1 bills. Save the file as dollarAmountToNotesFirstinitialLastname.c Sample output: Enter a dollar amount: 93 $20 bills: 4 $10 bills: 1 $5 bills: 0 $1 bills: 3 Hint: Divide the amount by 20 to determine the number...

  • Program Requirements ·         The program prompts the user to enter a loan amount and an interest rate....

    Program Requirements ·         The program prompts the user to enter a loan amount and an interest rate. ·         The application calculates the interest amount and formats the loan amount, interest rate, and interest amount. Then, it displays the formatted results to the user. ·         The application prompts the user to continue. ·         The program stops prompting the user for values after taking 3 loan amounts. ·         The application calculates and displays the total loan and interest amount and ends the program Example Output Welcome to...

  • Due: Wednesday June 10, 2020 A travel company has many British travelers going to the US...

    Due: Wednesday June 10, 2020 A travel company has many British travelers going to the US who would like to exchange their British Pounds into American dollars. They want you to explain how the American dollar amount will translate to the number of different bills and coins. There are many different ways to split a particular dollar amount into bills and coins, but they want to have as many high denomination bills and coins as possible. Assume that the highest...

  • Java project: A Bank Transaction System For A Regional Bank User Story A regional rural bank...

    Java project: A Bank Transaction System For A Regional Bank User Story A regional rural bank CEO wants to modernize banking experience for his customers by providing a computer solution for them to post the bank transactions in their savings and checking accounts from the comfort of their home. He has a vision of a system, which begins by displaying the starting balances for checking and savings account for a customer. The application first prompts the user to enter the...

  • in C please! Proiect Overview: A business owner is unhappy with the services provided by the...

    in C please! Proiect Overview: A business owner is unhappy with the services provided by the government and has chosen to pay the tax using a combination of coins including quarters, dimes, nickels, and pennies. In this project, you are asked to write a program to analyze the tax payment in coins. Th nickels and pennies the owner has paid. It then computes the total amount of tax paid in dollars and cents, and computes the weight of all the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT