A machine purchased for P28,000 is depreciated at a rate of P4,000 for seven years. Draw a flowchart, write an algorithm and design a C++ program that computes and displays in a suitably sized list box a depreciation table for seven years.
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double cost = 28000;
double depricated_rate = 4000;
cout << setprecision(2) << fixed;
cout << "Year Depreciated cost" << endl;
for (int year=0; year <= 7; year++) {
cout << " " << year << " P" << cost << endl;
cost -= depricated_rate;
}
}
Comments
Leave a comment