Click here to Skip to main content
15,918,268 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Compiler error!! !! Pin
nutkase12-Jan-05 22:18
nutkase12-Jan-05 22:18 
GeneralON_WM_KILLFOCUS Pin
digwizfox12-Jan-05 15:23
digwizfox12-Jan-05 15:23 
GeneralRe: ON_WM_KILLFOCUS Pin
Ryan Binns12-Jan-05 17:00
Ryan Binns12-Jan-05 17:00 
GeneralRe: ON_WM_KILLFOCUS Pin
digwizfox13-Jan-05 6:33
digwizfox13-Jan-05 6:33 
GeneralDynamic Views Pin
Anonymous12-Jan-05 15:12
Anonymous12-Jan-05 15:12 
GeneralRe: Dynamic Views Pin
Yulianto.12-Jan-05 15:31
Yulianto.12-Jan-05 15:31 
GeneralMSVC 2003 GUI Help Pin
c++code10112-Jan-05 14:31
c++code10112-Jan-05 14:31 
GeneralSending output to a printer Pin
BRIMID12-Jan-05 13:29
BRIMID12-Jan-05 13:29 
This program works ok. I get an exe file. But I would like to be able to send the output to a printer. How would I be able to send the output from the exe file after running it, to a printer? I have some code by the forward slashes. Thank You

// RWA's and Charges

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
using std::cout;
using std::cin;
using std::fixed;
using namespace std;
//#include

int main () //int,char*)


//ofstream printer ("lpt1:");
//Printer <<"test"<<endl;
//return 0;
//}


{
int c;
double fee;
double total;
char a ='y', ans;
string input;
int number;




while (a =='y'|| a =='Y')
{

cout << "\nChoose from options below.\n";
cout << "\nEnter A to calculate total RWA cost.\n";
cout << "\nEnter B to calculate RWA base estimate.\n";
cout << "\nEnter your choice, then press the enter key:\a";
cin >> ans;
cin.ignore();


if (ans == 'A' || ans == 'a' ){


cout << "\nEnter RWA Base Estimate, then press the enter key:$\a";
cin >> input;
cout << "You entered:$" << input << endl;
int pos = input.find(',');
while (pos != -1)
{
input.replace(pos, 1, "");
pos = input.find(',');
}
number = atoi(input.c_str());
fee = number * 0.04;
cout << fixed;
cout.precision(2);
cout << "4% Management Fee:$" << fee <<"\n";
total = number + fee;
cout << fixed;
cout.precision(2);
cout << "Total:$" << total <<"\n";


if (total >= 1 && total <= 2499)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.1 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999)
{

cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.005) <<"\n";
}


}


if (ans == 'B' || ans == 'b') {



cout << "\nEnter Total RWA Cost, then press the enter key:$\a";
cin >> input;
cout << "You entered:$" << input << endl;

int pos = input.find(',');
while (pos != -1)
{
input.replace(pos, 1, "");
pos = input.find(',');
}
number = atoi(input.c_str());
fee = number * 0.04;
cout << fixed;
cout.precision(2);
cout << "4% Management Fee:$" << fee <<"\n";
total = number - fee;
cout << fixed;
cout.precision(2);
cout << "Total:$" << total <<"\n";

if (total >= 1 && total <= 2499)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.1 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999)
{
cout << fixed;
cout.precision(2);
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000)
{
cout << fixed;
cout.precision(2);
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)?\a";
cin>> a;

}

cout <<"\nGoodBye\n";
getchar();
return 0;
cin >> c;

}

GeneralMFC socket programing problem Pin
shaihnc12-Jan-05 12:39
shaihnc12-Jan-05 12:39 
GeneralRe: MFC socket programing problem Pin
shaihnc13-Jan-05 5:32
shaihnc13-Jan-05 5:32 
GeneralSpeed of operators Pin
Malcolm Smart12-Jan-05 11:57
Malcolm Smart12-Jan-05 11:57 
GeneralRe: Speed of operators Pin
Rick York12-Jan-05 12:18
mveRick York12-Jan-05 12:18 
GeneralRe: Speed of operators Pin
Mike Dimmick12-Jan-05 12:19
Mike Dimmick12-Jan-05 12:19 
GeneralRe: Speed of operators Pin
Mike Dimmick12-Jan-05 12:59
Mike Dimmick12-Jan-05 12:59 
GeneralRe: Speed of operators Pin
Ryan Binns12-Jan-05 16:58
Ryan Binns12-Jan-05 16:58 
GeneralOnSize Function : Positioning Static Controls Pin
tnguyen44412-Jan-05 11:50
tnguyen44412-Jan-05 11:50 
GeneralRe: OnSize Function : Positioning Static Controls Pin
User 1278212-Jan-05 16:13
User 1278212-Jan-05 16:13 
GeneralRe: OnSize Function : Positioning Static Controls Pin
Ryan Binns12-Jan-05 17:01
Ryan Binns12-Jan-05 17:01 
GeneralRe: OnSize Function : Positioning Static Controls Pin
tnguyen44413-Jan-05 6:10
tnguyen44413-Jan-05 6:10 
GeneralForms Problem (new to Win32 programming) Pin
LighthouseJ12-Jan-05 11:30
LighthouseJ12-Jan-05 11:30 
GeneralChecking Namedpipe Access Pin
humps12-Jan-05 10:43
humps12-Jan-05 10:43 
GeneralSetActivePage in property page Pin
DanYELL12-Jan-05 9:58
DanYELL12-Jan-05 9:58 
GeneralRe: SetActivePage in property page Pin
Michael Dunn12-Jan-05 10:23
sitebuilderMichael Dunn12-Jan-05 10:23 
GeneralRe: SetActivePage in property page Pin
DanYELL12-Jan-05 12:28
DanYELL12-Jan-05 12:28 
GeneralRe: SetActivePage in property page Pin
Michael Dunn12-Jan-05 14:50
sitebuilderMichael Dunn12-Jan-05 14:50 

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.