Answer to Question #275986 in C++ for irum

Question #275986

write a c++ program that keeps track of budget for a user, you need to ask him about his total salary at the start of the month and then calculate his saving after his expenses. ask him about his electricity bills, gas water and rent house and at the end display how much he has saved


1
Expert's answer
2021-12-06T05:27:00-0500
#include <iostream>

using namespace std;

int main(void) {
  double total, tmp;
  cout << "Enter total salary: ";
  cin >> total;
  cout << "Electricity bills: ";
  cin >> tmp;
  total -= tmp;
  cout << "Gas: ";
  cin >> tmp;
  total -= tmp;
  cout << "Water: ";
  cin >> tmp;
  total -= tmp;
  cout << "Rent house: ";
  cin >> tmp;
  total -= tmp;
  cout << "saved salary: " << total << endl;
}

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