#include <iostream>
#include <conio>
int main ()
{
int proceed=1, itemCnt=0;
double price, totalPrice=0;
cout<<"Program To Calculate The Average and Total Price Of Items \n\n";
while (proceed==1)
{
cout<<"Enter price of item: ";
cin>>price;
totalPrice += price;
itemCnt++;
cout<<"Anymore item? Enter 1 for yes OR 0 for no: ";
cin>>proceed;
}
cout<<"\n\nYou have "<<itemCnt<< " Items";
cout<<"\nThe Average Price Of The Items Is "<<totalPrice/itemCnt;
cout<<"\nThe Total Price of the Items Is "<<totalPrice;
cout<<"\nEnd of Program";
getch ();
return 0;
}
#include <iostream>
usingnamespace std;
int main ()
{
bool proceed = true;
int itemCnt=0;
double price, totalPrice=0;
cout<<"Program To Calculate The Average and Total Price Of Items \n\n";
while (proceed)
{
cout<<"Enter price of item: ";
cin>>price;
totalPrice += price;
itemCnt++;
cout<<"Anymore item? Enter 1 for yes OR 0 for no: ";
cin>>proceed;
}
cout<<"\n\nYou have "<<itemCnt<< " Items";
cout<<"\nThe Average Price Of The Items Is "<<totalPrice/itemCnt;
cout<<"\nThe Total Price of the Items Is "<<totalPrice;
cout<<"\nEnd of Program";
return 0;
}