Answer to Question #156875 in C++ for Raihan Afryna binti Raizam

Question #156875

A machine purchased for RM28,000 is depreciated at a rate of RM4,000 a year for 7 years.

Write and run a C++ program that computes and displays a depreciation table for 7 years.


1
Expert's answer
2021-01-23T10:20:47-0500

//Correct

#include <iostream>


using namespace std;


int main()


{

int value = 28000;

cout << "Initial cost: RM" << value << endl;


for(int i = 1; i<=7; i++)

{

value -= 4000;

cout << "Cost after " << i << " years of use: RM " << value << endl;

}

return 0;

}


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