I have been given an assignment to plan, code, and execute a program to calculate data about a person. I am not here asking about how to code the program, but rather to troubleshoot at what's wrong with my compiler/command prompt. Here's what's happening: I will code a program in C++ using Crimson Editor as my text editor. With Windows XP, I use Borland Free Compiler to compile through the Command Prompt. After it compiles I execute(run) the program, but instead of printing the desired output to the command prompt screen, it opens a file with the .cpp code as the text. What is going on? I have no idea where to start and my finals programs are due by the end of the week. I am a second-semester freshman in college. All help or guidance is appreciated. Here is a sample program to use as a test:
#include <iostream>
#include <string>
using namespace std;
const int DAYS_PER_YEAR = 365;
const int OUNCES_PER_POUND = 16;
const int INCHES_PER_FOOT = 12;
int main ()
{
string name;
int age; int heightFeet; int heightInches;
double weight;
cout << "Please enter your first name, age, weight, and height in feet and inches, each separated by a space." << endl;
cin >> name >> age >> weight;
cin >> heightFeet >> heightInches;
cout << endl << "Age in days = " << age * DAYS_PER_YEAR << endl;
cout << "Weight in ounces = " << weight * OUNCES_PER_POUND << endl;
cout << "Height in inches = " << heightFeet * INCHES_PER_FOOT + heightInches << endl;
return 0;
}