In: Computer Science
The working code for the above program is given below
#include <iostream> //header file
using namespace std;
int main()
{
int item,i,total=0,price;
cout<<"Enter number of items ordered"<<endl;
cin>>item;
cout<<"enter price"<<endl;
for(i=0;i<item;i++) // for loop
{ cin>>price;
total=total+price; // total billing amount
}
if(total>=1000)
cout<<"total billing amount = "<<total <<" AED"; // billing > 1000
else
cout<<"total billing amount = "<<total+ (item*10)<<" AED"; // billing < 1000
return 0;
}
the screenshot of the output window
For reference i am giving screenshot of the program
You can comment if you have any doubt.
Upvote if you got your answer.
Thanks