I'm currently reading the book Problem Solving, Abstraction and Design using C++, by Frank L. Friedman and Elliot B. Koffman. I've taken several programming classes before and never had to deal with batch mode and to my surprise they cover this topic directly after learning how to do simple arithmetic. It's chapter 2.7, if you happen to own the book.
I was wondering how I get make this program into a batch file:
It's a very simple program, all I'm asking is what exactly am I supposed to do with it? The book mentions placing the symbols "> mydata" at the end of the command line that causes your compiled and linked program to execute, but I'm using an IDE, Microsoft Visual C++ Express, and don't know exactly what that means or what to do.Code://File: milesBatch.cpp //Converts distance in miles to kilometers #include <iostream> using namespace std; int main () { const float KM_PER_MILE = 1.609; float miles, kms; cin >> miles cout << "The distance in miles is " << miles; kms = KM_PER_MILE * miles; cout << "The distance in kilometers is " << kms << endl; return 0; }
If someone could give me easy-to-follow, step-by-step instructions of what to do, I would be incredibly grateful.



LinkBack URL
About LinkBacks


