According to this page:
"Double Declining Balance Method Depreciation Calculator"[
^], you have
#include<iostream>
#include<string>
using namespace std;
int main()
{
double asset_cost, salvage_val, deprec;
double percentage, acc_deprec;
const int YEARS = 10;
cout<<"Asset cost: ";
cin>>asset_cost;
cout<<"Salvage value: ";
cin>>salvage_val;
percentage = 100.0 / YEARS;
cout << "straight-line depreciation percentage " << percentage << endl;
acc_deprec = 0.0;
for(int y = 1; y <= 10 ; y++)
{
deprec = 2 * percentage / 100.0 * (asset_cost - acc_deprec);
acc_deprec += deprec;
cout<<deprec<<endl;
}
return 0;
}