I am very new the C++ with no programming background. I have written a program to figure out the interest on a 401K plan. I wrote the program and tried to run it and I keep getting a message that there is not an exe. file. What is causing this?
The first few program I wrote I did not have this problem, but the last 3 I have written I keep getting this message.

Any support on this is appreciated.....
Thanks,
Tina

Show your code and what compiler you use?

> I keep getting a message that there is not an exe. file. What is causing this?
Exact details please, not some vague "there's an error".
This means
- State your OS and compiler, with versions (not just windows and borland say)
- An example simple program which shows the problem - don't forget the code tags
- copy / paste any error messages you get.

Most compilers for example will not produce a .exe file if there are errors in your prog.cpp file.
So my guess is, is that it isn't compiling.

I am using windows XP.
The program is Microsoft Visual Studio.Net 2003
Unable to start debugging system could not find the exe.file.
Error:
C2109
Fatal Error:
C1075

Here is the first one:


// 3P1.cpp : Defines the entry point for the console application.
//Program Documentation:
// Name : <YOUR NAME>
// Date : <Date File was created>
// Description : Assignment 3 – Problem 1: Going Loopy
// Assignment/Problem : A3P1
// File Name : <Your User Name>A3P1.cpp
// Course : Intro to C++ CS2244
// Instructor : Raymond Welch

#include <iostream>
#include "stdafx.h"
using std::cin;
using std::cout;
using std::endl;


int _tmain(int argc, _TCHAR* argv[])
{
char ch=0;
int years=0;
int worth=0;

cout<<endl;


do{
cout<< "Enter the number of years you have worked \n";
cin>>years;
worth=1000[1+(.04*years)];

cout<< "Do you want to figure another number of years worked? (y/n): ";
cin>>ch;
cout<<endl;
} while (ch=='y');

{cout<< "Your 401K is now worth $";
cin>>worth;
cout<<endl;

return 0;
}

Here is the second one:

Unable to start debugging system could not find exe.file
Error: C2109
Fatal Error: C1075

// 3 2.cpp : Defines the entry point for the console application.
//#include "stdafx.h"
#include <iostream>
using std::cin;
using std::cout;
using std::endl;


int _tmain(int argc, _TCHAR* argv[])
{int sum=0;
int count=0;

cout<< "This program will take any number you enter,/n then it will add all numbers leading up to this number /n
to include the number giving you the sum./n Please enter a number";
cin>>count;

for(int i=1;i<=count;i++)
sum+=i;

cout<<endl
<<"The sum of the numbers 1 to "<<count
<<"is "<<sum<<endl;

return 0;
}

I hope this is what you were needing.....
If not, please let me know.
Thanks for your help!
T

> I keep getting a message that there is not an exe. file. What is causing this?
Exact details please, not some vague "there's an error".
This means
- State your OS and compiler, with versions (not just windows and borland say)
- An example simple program which shows the problem - don't forget the code tags
- copy / paste any error messages you get.

Most compilers for example will not produce a .exe file if there are errors in your prog.cpp file.
So my guess is, is that it isn't compiling.

I modified your first code. There were quite a number of errors in them.

#include <iostream>
 
using std::cin;
using std::cout;
using std::endl;


int main(int argc, char* argv[])
{
char ch=0;
int years=0;
int worth=0;

cout<<endl;


do{
cout<< "Enter the number of years you have worked \n";
cin>>years;

worth=1000*(1+.04*years);

cout<< "Do you want to figure another number of years worked? (y/n): ";
cin>>ch;
cout<<endl;
} 
while (ch=='y');
{
cout<< "Your 401K is now worth $";
cout<<worth;
cout<<endl;
}

return 0;
}

1) Changed worth=1000[1+(.04*years)]; to worth=1000*(1+.04*years);
Why were you using [ ] here?

2) Changed cin>>worth; to cout<<worth. You purpose is to output it to output stream. So, you need cout not cin.

3) There was a missing closing brace } of while. Braces are always even in number.

Regarding your second code:
Each string literal must appear entirely on one line of the program.

> don't forget the code tags
I guess that fell on deaf ears.

And I guess you don't see the background image of the edit window where you compose your messages, which also tells you about the code tags.

Programming is about attention to detail.

Press "compile" every few lines, not when the whole program is done. That way you're only ever a few edits between your last good program and the current crop of error messages.

> Each string literal must appear entirely on one line of the program.
The compiler will fold long lines like this example

cout << "This is an example"
    " of text spread over"
    " many lines\n";

Thank you for your assistance. Using formulas keeps me guessing. In switching math formulas into computer formulas I never know what () to use and when * is needed for multiplication instead of using ().

I have one more question for you......

I know this sounds stupid, but it shows just how green I am....

What are code tags and where should they be included??

Thanks again for your help......
T

Click on QUICK REPLY or ADVANCED REPLY and see the background image.

Unable to start debugging system could not find exe.file
Error: C2109
Fatal Error: C1075

// 3 2.cpp : Defines the entry point for the console application.
//#include "stdafx.h"
#include <iostream>
using std::cin;
using std::cout;
using std::endl;


int _tmain(int argc, _TCHAR* argv[])
{int sum=0;
int count=0;

cout<< "This program will take any number you enter,/n then it will add all numbers leading up to this number /n
to include the number giving you the sum./n Please enter a number";
cin>>count;

for(int i=1;i<=count;i++)
sum+=i;

cout<<endl
<<"The sum of the numbers 1 to "<<count
<<"is "<<sum<<endl;

return 0;
}

I hope this is what you were needing.....
If not, please let me know.
Thanks for your help!
T

I already answered this question.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.