473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

getting an exe. has stopped working when my code runs, what does this mean

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.             char *name;
  6.             float bal,stbal,deposits[50],withdrawals[50];
  7.             int nw,nd,i;
  8.  
  9.         printf("Welcome to the Sinclair Banking System.");  /* Introduction to program*/;
  10.         printf("\n\nPlease enter your first name: ");  /* User will be prompted to enter name*/;
  11.         scanf("%s",name);
  12.         fflush(stdin);
  13.  
  14.         printf("\nHello %s",name);  
  15.         printf("\nNow enter your balance in dollors and cents: ");  /* User will be prompted to enter a monetary amount.*/
  16.         scanf("%f",&bal);
  17.         fflush(stdin);
  18.  
  19.         while(bal<0)
  20. {
  21.         printf("\nBalance amount should be greater than zero");  /* If user enters 0 message will appear prompting to try again.*/
  22.         printf("\nenter your balance in dollors and cents:");     /* User prompted again to re-enter. */
  23.         scanf("%f",&bal);
  24.         fflush(stdin);
  25.  
  26. }
  27.         stbal=bal;
  28.         printf("\nEnter number of withdrawls: ");  /* User will be prompted to enter up to 5 withdrawals.*/
  29.         scanf("%d",&nw);
  30.         fflush(stdin);
  31.  
  32.         printf("\nEnter number of deposits: ");  /* User will be prompted to enter up to 5 deposits. */
  33.         scanf("%d",&nd);
  34.         fflush(stdin);
  35.  
  36.         for(i=0;i<nd;i++)
  37. {
  38.         printf("Enter the amount of deposit#%d: ",i+1);  /* User prompt to enter monetary amount of deposit. */
  39.         scanf("%f",&deposits[i]);
  40.         fflush(stdin);
  41.  
  42.         while(deposits[i]<0)
  43. {
  44.         printf("\nDeposit amount should be greater than zero");  /* If user enters 0, user will be re-prompted to enter again.*/
  45.         printf("\nEnter the amount of deposit#%d: ",i+1);
  46.         scanf("%f",&deposits[i]);
  47.         fflush(stdin);
  48. }
  49.             bal=bal+deposits[i];
  50. }
  51.             printf("\n");
  52.             for(i=0;i<nw;i++)
  53. {
  54.             printf("Enter the amount of withdrawl#%d: ",i+1);  /* User prompt to enter monetary amount of withdrawal.*/
  55.             scanf("%f",&withdrawals[i]);
  56.             fflush(stdin);
  57.  
  58.             while(withdrawals[i]>bal)
  59. {
  60.             printf("\n***withdrawl amount exceeds the current balance.***");  /* If user enters amount greater than the balance, error message will appear. */
  61.             printf("\nEnter the lower amount of withdrawl#%d: ",i+1);  /* User is prompted to re-enter amount. */
  62.             scanf("%f",&withdrawals[i]);
  63.             fflush(stdin);
  64. }
  65.             bal=bal-withdrawals[i];
  66.             if(bal==0)
  67. {
  68.             printf("\nyour balance is zero");  /* Balance of 0 is stated and no more withdrawals can be made. */
  69.             printf("\n***No more withdrawals should be made.***");
  70.             exit(0);
  71. }
  72. }
  73.  
  74.         printf("\n***The Closing balance %s is $%.2f ***\n",name,bal);  /* Based of the amount left in the bank, the appropiate message will appear. */
  75.         if(bal>=50000.00)
  76.         printf("\n*** %s it is time to invest some money!***\n",name);  
  77.         else if(bal>=15000.00 && bal<=49999.99)
  78.         printf("\n*** %s may be you should consider a CD!***\n",name);
  79.         else if(bal>=1000.00 && bal<=14999.99)
  80.         printf("\n*** %s keep up the good work!***\n",name);
  81.         else
  82.         printf("\n*** %s your balance is getting low!***\n",name);
  83.  
  84.             printf("\n***Bank Record***\n");
  85.             printf("Starting Balance:$%.2f\n",stbal);
  86.  
  87.             for(i=0;i<nd;i++)
  88.             printf("Deposit #%d: %.2f\n",i+1,deposits[i]);
  89.             printf("\n");
  90.             for(i=0;i<nw;i++)
  91.             printf("Withdrawal #%d: %.2f\n",i+1,withdrawals[i]);
  92.             printf("\n");
  93.             printf("\nEnding Balance: $%.2f",bal);
  94.             return 0;
  95. }
Apr 10 '11 #1
1 2214
weaknessforcats
9,208 Expert Mod 8TB
Do you mean that a) you create an exe and then b) run the exe abd then c) try to recreate the exe and it fails here?

If so, you may need to be sure the execution window for the original exe has been closed. Otherwise your build fails trying to write to a file that's in use.

If this is not your probem, please provide more information.
Apr 11 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mark E | last post by:
Hi Group, I have a new Dell server that has the .NET Framework 1.1 installed on Windows 2000 SP 3. All was well until I installed Project Server 2002. All of a sudden my ASP.NET pages...
4
by: Alan Silver | last post by:
Hello, I have been playing with some of the code in ASP.NET Unleashed, to try and understand what's going on. I am getting on pretty well, but have struck a problem. I was looking at samples for...
4
by: Ben | last post by:
Hello I recently used VS.NET 2003's Copy Project to create a "release' version of my asp.net app. On the same machine where the development has occured, I loaded the app and all worked fine. I...
4
by: Mike | last post by:
Hi all, I have a vb.net program running as a service that uses a network path to query a file. If System.IO.File.Exists(fpath & "\" & filename) Can anyone tell me why the above isn't working?...
0
by: michalpleban | last post by:
I have Visual Studio 2003 for quite some time, and was creating several setup projects with it. Suddently it stopped working. When I create a new setup project, and try to add a file in...
2
by: K B | last post by:
I'm sorry to post OT here but I was hoping that someone could help me. I use Visual Studio 2005 and suddenly my Find feature has completely stopped working. When I select it, the screen flickers...
2
latitude
by: latitude | last post by:
Have had a few questions here but no replies so far so thought id give it one more go: Im working on a textviewer/editor and have used autodetect url on it, and it has worked fine. But somewhere...
2
by: rhyme2ri2 | last post by:
Hi!! I'm using asp.net 1.1 I have a datalist which gets dynamic data which is of unbound size may be small sometimes and may be very very long sometimes....... Whatever the size of data may be...
1
by: rickcasey | last post by:
I wonder if anyone has experienced something like this, as it seems truly bizarre and is causing me to tear out my hair (what little there is left of it).... The exec() function just suddenly...
3
by: JamesB | last post by:
I am trying to insert a row to an Access database: INSERT INTO tblTest (Val1, Val2, Val3, Val4, Val5) VALUES ('blah', 0, '', '', 'foo'); If I run this in my code: String insStr = "INSERT...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.