subject

Convert the follwoing code into a object-oriented programming (OOP) application using secure and efficient C++ code. #include
#include
using namespace std;
int main()
{
float inital_Inv;
float month_Dep;
float annual_Int;
float num_Years;
float total_Ammt;
float int_Amunt;
float year_Inest;

try {

cout << "" << endl;
cout << "Data Input" << endl;
cout << "Initial Investment Amount: $ ";
cin >> inital_Inv;

cout << "Monthly Deposit: $ ";
cin >> month_Dep;
cout << "Annual Interest: % ";
cin >> annual_Int;
cout << "Number of years: ";
cin >> num_Years;
}
catch (float x) {

}

total_Ammt = inital_Inv;

cout << "\tBalance and Interest Without Additional Monthly Deposits" << endl;
cout << "" << endl;
cout << "Year\t\tYear End Balance\tYear End Earned Interest" << endl;
cout << "" << endl;

for (int i = 0; i < num_Years; i++) {

int_Amunt = (total_Ammt) * ((annual_Int / 100));

total_Ammt = total_Ammt + int_Amunt;

cout << (i + 1) << "\t\t" << fixed << setprecision(2) << "$" << total_Ammt << "\t\t\t\t" << "$" << int_Amunt << "\n";
}

total_Ammt = inital_Inv;
cout << "\n\n\tBalance and Interest With Additional Monthly Deposits\n";
cout << "\n";
cout << "Year\t\tYear End Balance\tYear End Earned Interest\n";
cout << "\n";

for (int i = 0; i < num_Years; i++) {
year_Inest = 0;
for (int j = 0; j < 12; j++) {

int_Amunt = (total_Ammt + month_Dep) * ((annual_Int / 100) / 12);

year_Inest = year_Inest + int_Amunt;

total_Ammt = total_Ammt + month_Dep + int_Amunt;
}
cout << (i + 1) << "\t\t" << fixed << setprecision(2) << total_Ammt << "\t\t\t\t" << year_Inest << "\n";
}
return 0;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
Program description: a c# app is to be created to produce morse code. the morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). in sound-oriented systems, the dot represents a short sound and the dash represents a long sound. separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. in a sound-oriented system, a space is indicated by a short period of time during which no sound is transmitted. the international version of the morse code is stored in the data file morse.txt.
Answers: 3
question
Computers and Technology, 22.06.2019 09:30
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
question
Computers and Technology, 22.06.2019 18:10
Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to the power of the second parameter. write a statement that calls to_the_power_of to compute the value of cube_side raised to the power of 3 and that associates this value with cube_volume.
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
You know the right answer?
Convert the follwoing code into a object-oriented programming (OOP) application using secure and eff...
Questions
question
Mathematics, 05.07.2019 13:00
question
History, 05.07.2019 13:00
question
Mathematics, 05.07.2019 13:00
question
Mathematics, 05.07.2019 13:00
Questions on the website: 13722361