Answer to Question #96980 in C++ for Dogg

Question #96980
A fixed percentage of water is taken out from a tank each day. Write a program, Tank.cpp, that
accepts as input:
 W, representing the amount of water in the tank at the start of the first day
 P, representing the fixed percentage of water taken out of the tank each day
and, starting from the first day, displays the number of the day, the amount of water taken out for
that day, and the amount of water remaining in the tank at the end of that day. Your program should
terminate after 30 days have been displayed or when the amount of water remaining is less than
100 units, whichever comes first.
1
Expert's answer
2019-10-21T15:31:39-0400
void Tank(double W, double P)
{
  int i =1;
  do
  {
   cout << "Number day: "<< i++ <<". Water taken: " << W*P/100 << ". Water remaining: "<< W*(100-P)/100 << endl;
   W*=(100-P)/100;
  } while (W >=100 && i <31);
}

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