Solved

Need this in basic C , just the solution in text form

Posted on 2000-05-05
8
172 Views
Last Modified: 2012-05-04
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)
0
Comment
Question by:Real4me
8 Comments
 

Expert Comment

by:scooter1
ID: 2783066
sounds easy why can't you do it?
0
 

Author Comment

by:Real4me
ID: 2783079
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
0
 

Expert Comment

by:scooter1
ID: 2783084
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.
0
 

Author Comment

by:Real4me
ID: 2783089
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...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:scooter1
ID: 2783091
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.
0
 

Expert Comment

by:scooter1
ID: 2783144
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;

0
 

Expert Comment

by:pushpak
ID: 2784566
#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"<<tax[i]<<"\n";
}
cout<<bill;
}


0
 

Accepted Solution

by:
vl_arunkumar earned 100 total points
ID: 2820804
I Real4me I hope this will solve Ur problem

Here with I am giving the code

#include<stdio.h>

main()
{
      int nitems=0; // no of items
      float total=0.0,price,tax=0.0;

      do
      {
      printf("Enter Item.%d) Price:(0 to exit):: ",nitems+1);
      scanf("%f",&price);
      tax=price*0.085;// tax calculation
      total+=tax+price; // total calculation
      if(price!=0)
      {
      nitems++;
      printf("No.of Items: %d  Total Amount with 8.5%% tax:%.1f \n",nitems,total); // printing the total
      }
      if(nitems==5) // checking for no.of items
      break;
      }while(price!=0); // if price is 0 it will come out
      printf("\n\nNo.of Items Purchased: %d\nTotal Bill Amout with 8.5%% tax: %.1f \n",nitems,total);
}
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to understand recursion 12 219
VS2015 compilation and missing DLLs 9 119
Using Diagnostic tools in VS2015: Unresoved allocations 19 66
Add values of each row in an array 3 50
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now