954,190 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with a problem with C++ program

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

tln26
Newbie Poster
9 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

Show your code and what compiler you use?

Grunt
Junior Poster
152 posts since Jul 2006
Reputation Points: 197
Solved Threads: 12
 

> 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.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

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 :
// Date :
// Description : Assignment 3 – Problem 1: Going Loopy
// Assignment/Problem : A3P1
// File Name : A3P1.cpp
// Course : Intro to C++ CS2244
// Instructor : Raymond Welch

#include
#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<>years;
worth=1000[1+(.04*years)];

cout<< "Do you want to figure another number of years worked? (y/n): ";
cin>>ch;
cout<>worth;
cout<
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<> 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.

tln26
Newbie Poster
9 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

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<

Grunt
Junior Poster
152 posts since Jul 2006
Reputation Points: 197
Solved Threads: 12
 

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

Grunt
Junior Poster
152 posts since Jul 2006
Reputation Points: 197
Solved Threads: 12
 

> 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";
Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

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

tln26
Newbie Poster
9 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

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

Grunt
Junior Poster
152 posts since Jul 2006
Reputation Points: 197
Solved Threads: 12
 

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

tln26
Newbie Poster
9 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

I already answered this question.

Grunt
Junior Poster
152 posts since Jul 2006
Reputation Points: 197
Solved Threads: 12
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You