#include<iostream>
#include<iomanip>
using namespace std;
int main(){
cout << "What is the wholesale price of the item? ";
double itemPrice;
cin >> itemPrice;
cout << "What is the expected number of days until the item is sold? ";
int daysUntilSold;
cin >> daysUntilSold;
assert(daysUntilSold <= 7);
double lowMarkup = itemPrice + (itemPrice * .05);
cout << fixed << setprecision(2);
cout << "Retail price of the item is $" << lowMarkup << endl;
}
This program almost does what it is supposed to do.
I was given an assignment and this is exactly what it says:
- You have been commissioned by a supermarket chain to write a program that will determine the retail price of an item given suitable input.
- Their pricing is as follows:
- Any item that is expected to be sold in a week is marked up 5%
- Any item that is expected to stay on the shelf for more than 1 week is marked up by 10%
- (This, in a nutshell, means that before 7 days the cost of the item is 5% more than wholesale, and after 7 days it's 10% more.)
- Input -- Whole sale prie of an item (Completed)
-- Expected number of days until the item is sold (Completed)
- Output -- The retail price of the item (Completed)
Here is what I don't understand: Use call-by-reference parameters for input.
Help plz!

New Topic/Question
Reply



MultiQuote




|