Click here to Skip to main content
15,915,172 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ascii conversion HELP!!! Pin
John R. Shaw23-Nov-04 14:02
John R. Shaw23-Nov-04 14:02 
GeneralRe: ascii conversion HELP!!! Pin
Member 153128723-Nov-04 14:06
Member 153128723-Nov-04 14:06 
GeneralRe: ascii conversion HELP!!! Pin
John R. Shaw23-Nov-04 14:42
John R. Shaw23-Nov-04 14:42 
GeneralRe: ascii conversion HELP!!! Pin
RYU^^23-Nov-04 19:16
RYU^^23-Nov-04 19:16 
GeneralRe: ascii conversion HELP!!! Pin
Member 153128723-Nov-04 21:23
Member 153128723-Nov-04 21:23 
Generalascii conversion HELP!!! Pin
Member 153128723-Nov-04 13:22
Member 153128723-Nov-04 13:22 
GeneralRe: ascii conversion HELP!!! Pin
Kehllendros23-Nov-04 13:42
Kehllendros23-Nov-04 13:42 
GeneralC++ Code help Pin
BRIMID23-Nov-04 12:24
BRIMID23-Nov-04 12:24 
What is wrong with this code? I get math errors,does not exit on entering n, and cannot print output? How do I make the program a page so the option to print is given.
// RWA's and Charges

#include <iostream>
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*0.015 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000 ||total >= 1,000,000 && total <= 2,425,000)
{
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.005) <<"\n";
}


}


if (choice == 2) {



cout << "\nEnter Total RWA Cost, 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 << "Spendable Amount:$" << total - (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999 ||total >= 2,500 && total <= 9,999 )
{
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999 ||total >= 10,000 && total <= 24,999 )
{
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999 ||total >= 25,000 && total <= 49,999)
{
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999 ||total >= 50,000 && total <= 99,999 )
{
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999 ||total >= 100,000 && total <= 299,999)
{
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999 ||total >= 300,000 && total <= 999,999 )
{
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000 ||total >= 1,000,000 && total <= 2,425,000)
{
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.005) <<"\n";
}



}

cout <<"********************************************************************""\n";
cout <<"***** Rate Range Subtotal Max. Range *****""\n";
cout <<"***** .01 .1 $2,499 $250.00 $250.00 *****""\n";
cout <<"***** 0.09 $2,500 $9,999 $675.00 $675.00 *****""\n";
cout <<"***** 0.08 $10,000 $24,999 $800.00 $1,200.00 *****""\n";
cout <<"***** 0.07 $25,000 $49,999 $1,750.00 *****""\n";
cout <<"***** 0.05 $50,000 $99,999 $2,500.00 *****""\n";
cout <<"***** 0.03 $100,000 299,999 $6,000.00 *****""\n";
cout <<"***** 0.015 $300,000 $999,999 $10,500.00 *****""\n";
cout <<"***** 0.005 $1,000,000 $2,425,000 $7,125.00 *****""\n";
cout <<"********************************************************************""\n";



cout<<"Would You Like to Perform Another Calculation (Y/N)?";
cin>>choice3;

}


//return 0;
cin >> c;
GeneralRe: C++ Code help Pin
RYU^^23-Nov-04 12:53
RYU^^23-Nov-04 12:53 
GeneralDialog Box error Pin
The_Server23-Nov-04 11:54
The_Server23-Nov-04 11:54 
GeneralRe: Dialog Box error Pin
The_Server23-Nov-04 12:26
The_Server23-Nov-04 12:26 
GeneralRe: Dialog Box error Pin
The_Server23-Nov-04 12:45
The_Server23-Nov-04 12:45 
QuestionGUID ? Pin
BaldwinMartin23-Nov-04 11:29
BaldwinMartin23-Nov-04 11:29 
GeneralSearching for video devices Pin
neilshelton23-Nov-04 11:20
neilshelton23-Nov-04 11:20 
GeneralSOCK_RAW on Microsoft Pin
Flame Gitsnik23-Nov-04 11:15
Flame Gitsnik23-Nov-04 11:15 
GeneralCTreeCtrl Drag and Drop Pin
Ian Bowler23-Nov-04 10:37
Ian Bowler23-Nov-04 10:37 
GeneralTray Bar Pin
The_Server23-Nov-04 10:36
The_Server23-Nov-04 10:36 
GeneralRe: Tray Bar Pin
Joaquín M López Muñoz23-Nov-04 11:38
Joaquín M López Muñoz23-Nov-04 11:38 
GeneralAttn All Members Pin
BaldwinMartin23-Nov-04 9:35
BaldwinMartin23-Nov-04 9:35 
GeneralRe: Attn All Members Pin
alex.barylski23-Nov-04 9:44
alex.barylski23-Nov-04 9:44 
GeneralRe: Attn All Members Pin
BaldwinMartin23-Nov-04 9:47
BaldwinMartin23-Nov-04 9:47 
GeneralRe: Attn All Members Pin
David Crow23-Nov-04 10:22
David Crow23-Nov-04 10:22 
GeneralRe: Attn All Members Pin
BaldwinMartin23-Nov-04 10:27
BaldwinMartin23-Nov-04 10:27 
GeneralRe: Attn All Members Pin
ThatsAlok23-Nov-04 17:11
ThatsAlok23-Nov-04 17:11 
GeneralRe: Attn All Members Pin
peterboulton23-Nov-04 22:54
professionalpeterboulton23-Nov-04 22:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.