Answer to Question #228304 in C++ for Onai Maxwell

Question #228304
COVID-19 has triggered panic buying from Americans with the expectation that there will be declaration of lockdown after the closure of school across the
country. Retailer are increasing the prices of their goods on the shelf based on
the time it stays on the shelf. The management of “Brutus Stores” have decided on this price policy. The price of any item which is expected to sell within a week should be increased by 20%. However, if an item stays on the shelf after a week but less than or equal to two weeks the price should be increase by 15%.
The price of any other item that stays on the shelf for more than two weeks
should be increase by 2%. As a programmer you have been consulted to
develop a program that will:

a. Request for item name, current price in $, expected duration on shelf.

b. Compute the retail price of the item.

c. Display the results.

d. Explain your results
1
Expert's answer
2021-08-22T07:16:20-0400
#include<iostream>
using namespace std;

int main()
{
    string name;
    double cprice;
    int duration;
   
    cout<<"\nEnter name: ";
    cin>>name;
    cout<<"\nEnter current price: ";
    cin>>cprice;
    cout<<"\nEnter duration: ";
    cin>>duration;
   
    double retail_price;
    if(duration<=7)
        retail_price=1.20*cprice;
    else if(duration>7 && duration<=14)
        retail_price=1.15*cprice;
    else if(duration>14)
        retail_price=1.02*cprice;
       
    cout<<"\nName: "<<name;
    cout<<"\nCurrent price: "<<cprice;
    cout<<"\nDuration: "<<duration; 
    cout<<"\nRetail price: "<<retail_price;
    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

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS