Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help in writting a very simple C++ program. Below al the information you

ID: 3558187 • Letter: P

Question

Please help in writting a very simple C++ program. Below al the information you need you must meet all the requierments.

In this assignment, you will be using integer division and modulo operator (%). Once the program is completed, you will compile the source code (ola3.cc) to create an executable code. If you made any mistake, you will need to use the editor to fix any error (bug) before you recompile the program. When there is no (syntax) error, you will execute the program by entering a.out. When the program asks you to enter an input value, enter a value such as 86. Verify your program by executing your program few times and checking for correct answers.

Problem Description: Write a program that determines the least number of coins to give out for the change between 1 cent and 99 cents. Use coin denominations of 25 cents (quarters), 10 cents (dimes), 5 cents (nickels), and 1 cent (pennies).   The following shows some sample runs of the program.

Sample Runs:

Sample Run 1

**************************************************

Welcome to the coin change machine.

Please enter the change amount: 87

The coins for change of 87 cents is

3 quarters, 1 dime, 0 nickel and 2 pennies.

Sample Run 2

**************************************************

Welcome to the coin change machine.

Please enter the change amount: 99

The coins for change of 99 cents is

3 quarters, 2 dimes, 0 nickel and 4 pennies.

Problem Details:    Your program prompts for and reads a change, calculates and prints the number of coins for each denomination with identifying messages.

REQUIREMENTS:-

Your program must have a beginning comment block and proper documentation.

Explanation / Answer

#include <iostream>
using namespace std;
int main ()
{
   int m;
   int n;
   int o;
   int p;
   int q;
   cout<<"*************************"<<endl;
   cout<<"Welcome to the coin change machine."<<endl;

cout<<"Please enter the change amount: ";
cin>>m;


   n=m / 25;
   o= (m-25*n) / 10;
   p=(m-25*n-10*o) /5;
   q=(m-25*n-10*o-5*p) / 1;
   cout<<"The coins for change of " << m <<" cents is ";
   cout<<n<<" quarters,";
       cout<<o<<" dimes,";
       cout<<p<<" nickels";
   cout<<" and "<<q<<"cents";
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote