Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Sending output to a printer

Sending output to a printer

Scheduled Pinned Locked Moved C / C++ / MFC
question
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BRIMID
    wrote on last edited by
    #1

    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 #include #include #include using std::cout; using std::cin; using std::fixed; using namespace std; //#include int main () //int,char*) //ofstream printer ("lpt1:"); //Printer <<"test"<> 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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups