1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
int readSaleRecord(unsigned&, double&, char&, unsigned&, double&);
double calculateItemCost(double itemPrice, double& totalCost, char discountType, unsigned quantity);
void displayTotalCost(double totalCost, unsigned Num, bool aborted);
int addRecord(unsigned allIDs[], double allPrices[], char allDiscounts[], unsigned allQuantities[], int &totalRec);
int main()
{
unsigned itemId, quantity, records, num, allIDs, allQuantities;
double itemPrice, totalCost, discount, recordNum, allPrices;
char discountType, allDiscounts;
bool aborted=false, ItemDetails;
int totalRec, i, j=0;
for(i=0;i<100;i++){
readSaleRecord(itemId, itemPrice, discountType, quantity, recordNum);
if(true == 1){
calculateItemCost(itemPrice, totalCost, discountType, quantity);
displayTotalCost(totalCost, num, aborted);}
calculateItemCost(itemPrice, totalCost, discountType, quantity);
displayTotalCost(totalCost, num, aborted);
}
// probably don't need this
addRecord (allIDs[10], allPrices[10], allDiscounts[10], allQuantities[10], totalRec[10]);{
allIDs[i] = itemId;
allPrices[i] = itemPrice;
allDiscounts[i] = discountType;
allQuantities[i] = quantity;
allCosts[i] = totalCost;
totalRec = totalRec + totalCost;
}
|