Real4me
asked on
Need this in basic C , just the solution in text form
Write a C program for the Grocery store checkout counter.
Ask and Enter the price of each item. The program should
display the total bill amount using one decimal digit. Use a tax rate of 8.5%. Use increment operator to keep
track of the number of items processed. Compute the bill amount using the tax rate. Show the bill amount (1 decimal digit)and the number of items processed.
(Assume the counter can process less than or equal to 5 items only -i,e, Express Lane counter)
Ask and Enter the price of each item. The program should
display the total bill amount using one decimal digit. Use a tax rate of 8.5%. Use increment operator to keep
track of the number of items processed. Compute the bill amount using the tax rate. Show the bill amount (1 decimal digit)and the number of items processed.
(Assume the counter can process less than or equal to 5 items only -i,e, Express Lane counter)
sounds easy why can't you do it?
ASKER
because I know next to nothing about C, but I need the grade and I need to learn ...so I thought if I put it out here and some one puts it in form...I'll be able to understand it better..and have something to work from trying to operate this compiler...can you answer them?? pleaseeeeee..yep!!! I'm begging
we are not suppose to give you the complete final code here at experts-exchange we are only suppose to help and guide you...I could get you started though.
ASKER
ok ... I'll take anything you can give me...starting them is the hardest part for me... I think I can figure them out once they get started...
we are not suppose to give you the complete final code here at experts-exchange we are only suppose to help and guide you...I could get you started though.
Ok so here's some of the basics well pretty much all you have to do is get it to loop.
int iNumItems = 0;
double itotal;
cout<<"Enter Item Prices:\n";
double iPrices;
cin>>iPrices; //ask for price
iNumItems = iNumItems + 1; //update number of items
itotal = iPrices + (.087* iPrices); ///get total with tax
//output it all
cout<<"Total Price:";
cout<<itotal;
cout<<"\nTotal Items:";
cout<<iNumItems;
int iNumItems = 0;
double itotal;
cout<<"Enter Item Prices:\n";
double iPrices;
cin>>iPrices; //ask for price
iNumItems = iNumItems + 1; //update number of items
itotal = iPrices + (.087* iPrices); ///get total with tax
//output it all
cout<<"Total Price:";
cout<<itotal;
cout<<"\nTotal Items:";
cout<<iNumItems;
#include<iostream.h>
#include<string.h>
#include<conio.h>
void main()
{
int tax[5],price[5], i,j,k,l, m , item[5], total[5];
string name;
float bill;
cout<<"please enter ur name"
cin>>name;
cout>>"please enter item1 to item5 quantity inserialy if do not want enter zero "
for (i=0;i<5;i++)
cin>>item[i];
for (i=0;i<5;i++)
{
total[i]=price[i]*item[i];
tax[i]=.085*tot[i]
bill=total[i]+tax[i];
}
for(i=0;i<5;i++)
{
cout<<"item"<< i<<"\t"<<total[i]<<"\t"<<t ax[i]<<"\n ";
}
cout<<bill;
}
#include<string.h>
#include<conio.h>
void main()
{
int tax[5],price[5], i,j,k,l, m , item[5], total[5];
string name;
float bill;
cout<<"please enter ur name"
cin>>name;
cout>>"please enter item1 to item5 quantity inserialy if do not want enter zero "
for (i=0;i<5;i++)
cin>>item[i];
for (i=0;i<5;i++)
{
total[i]=price[i]*item[i];
tax[i]=.085*tot[i]
bill=total[i]+tax[i];
}
for(i=0;i<5;i++)
{
cout<<"item"<< i<<"\t"<<total[i]<<"\t"<<t
}
cout<<bill;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.