# Thread: Cash register program? I'm lost

1. ## Cash register program? I'm lost

I am totally new to programming and I'm feeling like an idiot. I need to write a c++ program, basically a cash register program is what I've been told it's commonly called. It needs to ask for amount owed, amount paid, and display the change and break the change down into dollars,quarters,dimes,nickels,pennies. If the amount paid is less then the amount owed it needs to display a message saying the customer owes whatever the difference is. I'm supposed to use a "nested if" here is what I have so far :
Code:
```#include<iostream>
#include<iomanip>

using namespace std;

int main()

{
float a,b,c;
cout<<"Enter amount owed \$ : ";
cin>>a;
cout<<"Enter amount paid \$ : ";
cin>>b;
c=a-b;
cout<<"Your change is \$ : ";

if (c>=0)
{    cout<<"You owe \$ : ";
cout<<c*-1;
}

cout<<fixed;
cout<<setprecision(2);
cout<< c;

cout << endl << endl;
system("pause");
return 0;

}```
And this is where I become totally lost, I don't really get how to break the change down. I'm not sure how to actually write the nested if.

2. Use modulus...im not sure how to spell it but it is an arithmetic symbol that looks like this. % .
Which gives the remainder of a number divided by a number. Hope that helps a little bit

3. I'm supposed to use a "nested if" here is what I have so far :
You may want to study this link: Control Structures and then actually try to solve the problem.
And this is where I become totally lost, I don't really get how to break the change down.
You may to first turn off your computer, and try a few examples of making change the old fashioned way with pencil and paper. Once you know how to manually make change transfer that knowledge into a computer program.

Use modulus...im not sure how to spell it but it is an arithmetic symbol that looks like this. % .
The modulus operator % will not work with floating point numbers.