help with two transactions

i need help with writing a code for lets say one transaction and then for the second transaction the numbers are changed but iam told to copy and paste the code for the first transaction and just change the values. when i copy and paste the code i change the values but everything is just underlined and says this has no storage or type specifier.

 
  
Why don't you show us the trouble code?
ok say i have

double totalSellingPriceBoth;
double totalProfitBothSales;

totalSellingPriceBoth = 0.0;
totalProfitBothSales = 0.0;

so the total of transaction 1 and the total of transaction 2 i would want to get the total of both of the doubles.

how do i accumulate the transaction 1 and the transaction 2 to get the totalselling and totalprofit of both,

say total sellingprice of one is 126.99
total sellingprice of two is 159.99

now i want to get the totalsellingprice of both to = 286.98.


You add them together...

 
double totalSellingPriceBoth = totalSellingPriceOne + totalSellingPriceTwo;


Anyway, you might want to refer to a couple beginning tutorials on C++ if you're already having trouble with this.

Edit:
I don't know how to tell you to calculate the total profit because there is no way to calculate that from the selling prices alone.
Last edited on
Topic archived. No new replies allowed.