If you have any doubts, please give me comment...
#include<stdio.h>
#include<math.h>
int main(){
int quarters, dimes, nickles, pennies;
printf("Enter the number of quarters: ");
scanf("%d", &quarters);
printf("Enter the nummber of dimes: ");
scanf("%d", &dimes);
printf("Enter the number of nickles: ");
scanf("%d", &nickles);
printf("Enter the number of pennies: ");
scanf("%d", &pennies);
int total_payment = quarters*25 + dimes*10 + nickles*5 + pennies;
float total_weight = (quarters*5.67 + dimes*2.268 + nickles*5.0 + pennies*2.5) * 0.00220462;
int dollars = total_payment/100;
int cents = total_payment%100;
printf("Total payment is %d dollars and %d cents.\n", dollars, cents);
printf("Total weight of all the coins is %f\n", total_weight);
total_payment /= 100;
int twenty_dollar_bills = total_payment/20;
int ten_dollar_bills = (total_payment%20)/10;
int five_dollar_bills = ((total_payment%20)%10)/5;
int one_dollar_bills = ((total_payment%20)%10)%5;
printf("It is recommended to use the following payment form: ");
printf("\n\t%d twenty-dollar bills\n\t%d ten-dollar bills\n\t%d five-dollar bills\n\t%d one-dollar bills\n", twenty_dollar_bills, ten_dollar_bills, five_dollar_bills, one_dollar_bills);
int min_weight = twenty_dollar_bills + ten_dollar_bills + five_dollar_bills + one_dollar_bills;
printf("It achieves the minimal weight of %d grams or %f pounds\n", min_weight, (min_weight * 0.00220462));
return 0;
}
in C please! Proiect Overview: A business owner is unhappy with the services provided by the...
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...
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)...
Can you please help me with creating this Java Code using the following pseudocode? Make Change Calculator (100 points + 5 ex.cr.) 2019 In this program (closely related to the change calculator done as the prior assignment) you will make “change for a dollar” using the most efficient set of coins possible. In Part A you will give the fewest quarters, dimes, nickels, and pennies possible (i.e., without regard to any ‘limits’ on coin counts), but in Part B you...
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...
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...
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...
it c++ coding. please write on atom software.
1. Write a program that converts dollars into coins a. Request a dollar amount as an integer: $5.34 is input as 534 b. Use a constant variable to represent each coin as a fixed value: const int NICKEL 5; c. Use division and the mod function to calculate the number of each coin. Change Calculator Enter dollar amount (as an integer): $534 The equivalent in coins: 21 Quarters 0 Dimes 1 Nickels...
In c++
Write a program that asks users to input the amount of money (in cents) that will be exchanged to the least number of coins of the same value, output the results. Assume there are quarters (25c), dimes (10c), nickels(5c) and pennies(1c) available. ■CA 32 cmd.e eas input the anount of money (in cents) you want to exchange 39 39 can be exchanged to uarter: 25 me: 1 kel: e enny: 4 ress any key to continue-.
Please use C# For this project, we will see what it's like to write a simple windows application program that we can perform easily in our heads. You'll find that writing programs is similar to explaining things to a 5-year-old. You are to make this program "user friendly". In other words, make sure valid data has been entered. You are to create a simple change program. The user enters the amount due and the amount tendered. You are to calculate...
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...