Answer to Question #262081 in C++ for kashan

Question #262081

Jason typically uses the Internet to buy various items. If the total cost of the items ordered, at

one time, is $200 or more, then the shipping and handling is free; otherwise, the shipping and

handling is $10 per item. Write a program that prompts Jason to enter the number of items

ordered and the price of each item. The program then outputs the total billing amount. You

have to use a loop (repetition structure) to get the price of each item. (For simplicity, you may

assume that Jason orders no more than nine (9) items at a time.)


1
Expert's answer
2021-11-06T13:51:53-0400
#include <iostream>
using namespace std;


int main()
{
int noItem,itemPrice, amount, c;
   while(noItem<9)
   {
    cout<<"Enter the number of item: ";
    cin>>noItem;
    cout<<"Enter the price of each Item $ ";
    cin>>itemPrice;
   }
   amount=noItem*itemPrice;
   if(amount>=200)
   {
       cout<<"The the shipping and handling is free!"<<endl;
       cout<<"The total billing:$ "<<amount<<endl;
   }
   else
   {
       c=noItem*10;
       amount+=c;
       cout<<"The total billing:$ "<<amount<<endl;
   }
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Kashan
06.11.21, 21:50

Thanku so much

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS