Answer to Question #262346 in C++ for Alunsina

Question #262346

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.



1
Expert's answer
2021-11-09T17:45:26-0500


#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;
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS