C++ Help
-
Code does math calculations twice, gives exponential when amount is 1,000,000 and does not exit when n is entered for continuance. I would also like to know how to create this so the person using it could print the output. // RWA's and Charges #include using std::cout; using std::cin; using namespace std; //using::endl; int main() { int choice, c; float amount,total,fee; char choice3 ='y'; while(choice3=='y'|| choice3=='Y') { cout << "\nChoose from options below.\n"; cout << "\nEnter 1 to calculate total RWA cost.\n"; cout << "\nEnter 2 to calculate RWA base estimate.\n"; cout << "\n\t\tEnter your choice, then press the enter key:"; cin >> choice; if (choice == 1){ cout << "\nEnter RWA Base Estimate, then press the enter key:$"; cin >> amount; fee = amount * 0.04; cout << "4% Management Fee:$" << fee <<"\n"; total = amount + fee; cout << "Total:$" << total <<"\n"; if (total >= 1 && total <= 2499 ||total >= 1 && total <= 2,499) { cout << "Overhead:$" << total*0.1 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.1) <<"\n"; } if (total >= 2500 && total <= 9999 ||total >= 2,500 && total <= 9,999 ) { cout << "Overhead:$" << total*0.09 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.09) <<"\n"; } if (total >= 10000 && total <= 24999 ||total >= 10,000 && total <= 24,999) { cout << "Overhead:$" << total*0.08 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.08) <<"\n"; } if (total >= 25000 && total <= 49999 ||total >= 25,000 && total <= 49,999) { cout << "Overhead:$" << total*0.07 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.07) <<"\n"; } if (total >= 50000 && total <= 99999 ||total >= 50,000 && total <= 99,999 ) { cout << "Overhead:$" << total*0.05 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.05) <<"\n"; } if (total >= 100000 && total <= 299999 ||total >= 100,000 && total <= 299,999) { cout << "Overhead:$" << total*0.03 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.03) <<"\n"; } if (total >= 300000 && total <= 999999 ||total >= 300,000 && total <= 999,999) { cout << "Overhead:$" << total*
-
Code does math calculations twice, gives exponential when amount is 1,000,000 and does not exit when n is entered for continuance. I would also like to know how to create this so the person using it could print the output. // RWA's and Charges #include using std::cout; using std::cin; using namespace std; //using::endl; int main() { int choice, c; float amount,total,fee; char choice3 ='y'; while(choice3=='y'|| choice3=='Y') { cout << "\nChoose from options below.\n"; cout << "\nEnter 1 to calculate total RWA cost.\n"; cout << "\nEnter 2 to calculate RWA base estimate.\n"; cout << "\n\t\tEnter your choice, then press the enter key:"; cin >> choice; if (choice == 1){ cout << "\nEnter RWA Base Estimate, then press the enter key:$"; cin >> amount; fee = amount * 0.04; cout << "4% Management Fee:$" << fee <<"\n"; total = amount + fee; cout << "Total:$" << total <<"\n"; if (total >= 1 && total <= 2499 ||total >= 1 && total <= 2,499) { cout << "Overhead:$" << total*0.1 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.1) <<"\n"; } if (total >= 2500 && total <= 9999 ||total >= 2,500 && total <= 9,999 ) { cout << "Overhead:$" << total*0.09 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.09) <<"\n"; } if (total >= 10000 && total <= 24999 ||total >= 10,000 && total <= 24,999) { cout << "Overhead:$" << total*0.08 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.08) <<"\n"; } if (total >= 25000 && total <= 49999 ||total >= 25,000 && total <= 49,999) { cout << "Overhead:$" << total*0.07 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.07) <<"\n"; } if (total >= 50000 && total <= 99999 ||total >= 50,000 && total <= 99,999 ) { cout << "Overhead:$" << total*0.05 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.05) <<"\n"; } if (total >= 100000 && total <= 299999 ||total >= 100,000 && total <= 299,999) { cout << "Overhead:$" << total*0.03 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.03) <<"\n"; } if (total >= 300000 && total <= 999999 ||total >= 300,000 && total <= 999,999) { cout << "Overhead:$" << total*
Assuming you mean printing the output on a printer, I would suggest looking in the articles under the Printing section. I've never done any printing outside of an MFC app, so I can't help you much. There may be some easy way of printing from a console, but I couldn't tell you what it is. The articles provide some good starting points, but judging from the simplicity of your application its probably more work than its worth.
-
Code does math calculations twice, gives exponential when amount is 1,000,000 and does not exit when n is entered for continuance. I would also like to know how to create this so the person using it could print the output. // RWA's and Charges #include using std::cout; using std::cin; using namespace std; //using::endl; int main() { int choice, c; float amount,total,fee; char choice3 ='y'; while(choice3=='y'|| choice3=='Y') { cout << "\nChoose from options below.\n"; cout << "\nEnter 1 to calculate total RWA cost.\n"; cout << "\nEnter 2 to calculate RWA base estimate.\n"; cout << "\n\t\tEnter your choice, then press the enter key:"; cin >> choice; if (choice == 1){ cout << "\nEnter RWA Base Estimate, then press the enter key:$"; cin >> amount; fee = amount * 0.04; cout << "4% Management Fee:$" << fee <<"\n"; total = amount + fee; cout << "Total:$" << total <<"\n"; if (total >= 1 && total <= 2499 ||total >= 1 && total <= 2,499) { cout << "Overhead:$" << total*0.1 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.1) <<"\n"; } if (total >= 2500 && total <= 9999 ||total >= 2,500 && total <= 9,999 ) { cout << "Overhead:$" << total*0.09 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.09) <<"\n"; } if (total >= 10000 && total <= 24999 ||total >= 10,000 && total <= 24,999) { cout << "Overhead:$" << total*0.08 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.08) <<"\n"; } if (total >= 25000 && total <= 49999 ||total >= 25,000 && total <= 49,999) { cout << "Overhead:$" << total*0.07 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.07) <<"\n"; } if (total >= 50000 && total <= 99999 ||total >= 50,000 && total <= 99,999 ) { cout << "Overhead:$" << total*0.05 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.05) <<"\n"; } if (total >= 100000 && total <= 299999 ||total >= 100,000 && total <= 299,999) { cout << "Overhead:$" << total*0.03 <<"\n"; cout << "Total Obligation:$" << total + (total * 0.03) <<"\n"; } if (total >= 300000 && total <= 999999 ||total >= 300,000 && total <= 999,999) { cout << "Overhead:$" << total*