C++
Write a program that helps a young student learn to make change.
Use the random number generator to generate change amounts
between1¢ and 99¢. Ask the user how many quarters, dimes, nickels
and pennies they need to make that amount. Determine whether the
coins specified by the user total the specified amount and give
them feedback on their answer including whether they used the
minimum or optimum number of coins to produce the amount.
Sample output of a program that satisfies the requirements is shown
below. The data entered by the user is in blue.

Answer:
Explanation:
First using rand() function, random number is generated for coins variable, then it is copied to tem for future use as the coins variable will be modified.
Then, asking the user given values for quarters, dimes, nickles and pennies and storing in a, b, c and d.
Then, the actual solution is calculated and stored in quarters, dimes, nickles, and pennies variables.
Then using if else block, the values of user are added and if those coins give a value of temp. Answer is correct. If it does not matches with the optimum solution, optimum solution is printed.
In the else block, it is printed that the answer is wrong and the solution is also printed.
Code:
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
srand(time(0));
int coins = rand()%99 + 1;
int temp = coins;
cout<<"What coins are needed to make
$0."<<coins<<"?"<<endl<<endl;
int a, b, c, d;
cout<<"Quarters? ";
cin>>a;
cout<<"Dimes? ";
cin>>b;
cout<<"Nickles? ";
cin>>c;
cout<<"Pennies? ";
cin>>d;
int quarters = coins/25;
coins = coins%25;
int dimes = coins/10;
coins = coins%10;
int nickles = coins/5;
coins = coins%5;
int pennies = coins/1;
if(((a*25) + (b*10) + (c*5) + (d*1))==temp)
{
cout<<"Excellent that is correct!"<<endl;
if(a!=quarters || b!=dimes || c!=nickles || d!=pennies)
{
cout<<"The optimum solution is:"<<endl;
}
}
else
{
cout<<"That is not correct!"<<endl;
cout<<"The solution is: "<<endl;
}
cout<<"\tQuarters: "<<quarters<<endl;
cout<<"\tDimes: "<<dimes<<endl;
cout<<"\tNickles: "<<nickles<<endl;
cout<<"\tPennies: "<<pennies<<endl;
return 0;
}
Output:

PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!
C++ Write a program that helps a young student learn to make change. Use the random...
*Create in Python 3: Change Calculator Create a program that calculates the coins needed to make change for the specified number of cents. Sample Console Output Change Calculator Enter number of cents (0-99): 99 Quarters: 3 Dimes: 2 Nickels: 0 Pennies: 4 Continue? (y/n): y Enter number of cents (0-99): 55 Quarters: 2 Dimes: 0 Nickels: 1 Pennies: 0 Continue? (y/n): n Bye! Specifications The program should display the minimum number of quarters, dimes, nickels, and pennies that one needs...
(In Python 3) Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 (or less than 0), the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes So...
Problem: Implement (in C) the dynamic program algorithm for the coin-change algorithm, discussed in class. Assume that the coins with which you make change are quarters, dimes, nickels and pennies. Thus you are going to set n = 4 in your program. The amount k for which you have to make change will be provided by the user and your program will return the minimum number of coins needed and also the break-up of the change in terms of the...
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...
Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes
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...
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....
In Python 3, 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. In order to avoid roundoff errors, the program user should supply both amounts in pennies, for example 526 instead of 5.26. Enter the amount due in pennies: 828 Enter the amount received from the customer in...
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...
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...