I need an algorithm to be able to calculate cost when there is a sale for buy two get one free
1
Expert's answer
2014-03-13T13:43:40-0400
#include <iostream> #include <cmath>
using namespace std;
int main() { int n = 0; cout <<"Enter number of items please: "; cin >> n; double total = 0, temp = 0; for (int i = 1; i <= n; ++i) { cout << "Enter price of item number " << i << ": "; cin >> temp; if (i % 3) total += temp; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment