Flowchart of this C++ program, pleasee
Flowchart of this C++ program, pleasee
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
string name;
string Month;
string Bills, Personal, Transportation, Savings;
int day, year;
char dollar;
dollar = '$';
char percent;
percent = '%';
long double inc;
long double sav;
long double extra;
long double TOTAL;
double B, P, T, S;
double Bpercent, Ppercent, Tpercent, Spercent;
double MB, MP, MT, MS;
cout << "A SIMPLE BUDGET PLANNER TO ORGANIZE YOUR FINANCES";
cin.get();
cout << "Enter your name: ";
getline (cin, name);
cout << " " << endl;
cout << "Provide the details for the date today.\n";
cout << "Press Enter to continue";
cin.get();
cout << " " << endl;
cout << "Enter the Month : ";
cin >> (cin, Month);
cout << "Enter the day : ";
cin >> (cin, day);
cout << "Enter the year : ";
cin >> (cin, year);
cout << " " << endl;
cout << fixed << showpoint;
cout << setprecision(3);
cout << "Your Monthly Income: "<< dollar;
cin >> inc;
cout << fixed << showpoint;
cout << setprecision(3);
cout << "Savings: "<< dollar;
cin >> sav;
cout << fixed << showpoint;
cout << setprecision(3);
cout << "Extra Income: " << dollar;
cin >> extra;
TOTAL = (inc + sav + extra);
cout << "Total Cash = ";
cout << TOTAL;
cout << " " << endl;
cin.ignore();
cout << "Press Enter to continue";
cin.get();
cout << " " << endl;
cout << "Based on your Total Cash, the program will budget your money" << endl;
cout << "in terms of Bills, Personal, Transportation, and Savings." << endl;
cout << "Press Enter to continue";
cin.get();
cout << " " << endl;
cout << name << ", please make sure that the four(4) percentage/s that you" << endl;
cout << " enter will sum up to 100." << endl;
cout << "Press Enter to continue";
cin.get();
cout << " " << endl;
cout << "Type the percentage you will dedicate on each budget." << endl;
cout << "Press Enter to continue";
cin.get();
cout << " " << endl;
cout << "Bills = " << percent;
cin >> B;
cout << "Personal = " << percent;
cin >> P;
cout << "Transportation = " << percent;
cin >> T;
cout << "Savings = " << percent;
cin >> S;
Bpercent = (B / 100);
MB = (TOTAL * Bpercent);
Ppercent = (P / 100);
MP = (TOTAL * Ppercent);
Tpercent = (T / 100);
MT = (TOTAL * Tpercent);
Spercent = (S / 100);
MS = (TOTAL * Spercent);
cout << " " << endl;
cout << "Tabulating input datas..." << endl;
cin.ignore();
cout << " Done! Press Enter to Continue";
cin.get();
cout << " " << endl;
cout << name <<"'s Budget " << "as of " << Month << " " << day << "," << year << ":" << endl;
cout << "-------------------------------------------------------------------------------" << endl;
cout << " Bills Personal Transportation Savings" << endl;
cout << "-------------------------------------------------------------------------------" << endl;
cout << setw(15) << Bills << setw(35) << Personal << setw(50) << Transportation << setw(65) << Savings << endl;
cout << setw(17) << MB << setw(20) << MP
<< setw(25) << MT << setw(17) << MS << endl;
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images