Help I need to create a program Using C language while state
Help!! I need to create a program Using C++ language (while statements, for statements, if statements, loops, etc) (the longer the program, the better)
You are at my store and I am a stickler for making sure the cash drawer is exactly correct each night. I need a program that takes in two inputs:
1) The total amount of any sale (tax and any discounts already included)
2) The amount of money the customer gave you
The program will then calculate and display the exact amount of change to be given back to the customer. Not so easy; the display will tell you exactly how many of each of the following to give to the customer:
Dollars: 20, 10, 5 and 1
Change: quarters, dimes, nickels and pennies
In other words, for the money denominations listed above, your program must calculate and display the number of each denomination (if needed).
Example: The following is an example of the console display
Amount of sale: $35.67
Amount tendered: $40.00
The change is . . . $4.33
4 one dollar bills, 1 quarter, 1 nickel, 3 pennies
An IPO chart is also needed.
Code must match the development process exactly! If something appears in one, it must be found in the other. You must put this as your input: Total sale: $23.45 Amount tendered: $100
Solution
#include<iostream.h>
int main()
{
int Dollars;
float amount_of_sale,amount_tendered,change;
const float cTaxRate = 8.50;
const float discountRate=30/100;
cout << “Enter the prize of Quantity: \";
cin >> Dollars++;
for(int i=0;i<=dollaers;i++)
amount_of_sale=Dollars+ cTaxRate+ discountRate;
Cout<<”The Total Amount Of Sales =$”<<amount_of_sale<<”\ ”;
Amount_tendered=amount_of_sale+5;
Cout<<”The Tendered is:$”<<amount_tendered<<”\ ”;
Count<<”The Total Change is:$”<<amount_tendered-amount_of_sale<<”\ ”;
getch();
return 0;
}
