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
#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;
}
Comments
Leave a comment