445,655 Members | 1,005 Online
Need help? Post your question and get tips & solutions from a community of 445,655 IT Pros & Developers. It's quick & easy.

# Coin Change Program

 P: 1 Homework Assignment: Write program to compute the coins necessary to return change made up of quarters, dimes, nickels, and pennies. We are not allowed to use if/else or loops in this program. I am a beginner who knows very little about C++. We are working from Deitel's fourth edition and using the Visual C++ 6.0 compiler. I have worked for days on this problem and cannot figure out the logic part of it. I am using Windows 95 right now and don't have a compiler but have access to one later. This is what I have so far: Expand|Select|Wrap|Line Numbers   #include  using namespace std; void main () {   float Qvalue=.25;//The value of a quarter float Dvalue=.10;//The value of a dime float Nvalue=.05;//The value of a nickel float Pvalue=.01;//The value of a penny   float change_amt;//Memory for user input   int Qcount=0;//Initialize quarter count to 0 int Dcount=0;//Initialize dime count to 0 int Ncount=0;//Initialize nickel count to 0 int Pcount=0;//Initialize penny count to 0   Qcount+=1;//Increment Qcount by 1 Dcount+=1;//Increment Dcount by 1 Ncount+=1;//Increment Ncount by 1 Pcount+=1;//Increment Pcount by 1   cout<<"Enter change amount in 2 digit decimal format" <<"\n"; cin>>change_amt;//2 digit decimal format only   (change_amt !<=.00) || (change_amt !>.99);   cout<<"Change is comprised of:"    <